Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unable to take screenshot on Wayland session of KDE Plasma >5.80 #424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
glaubersm opened this issue Sep 21, 2020 · 31 comments
Closed

Unable to take screenshot on Wayland session of KDE Plasma >5.80 #424

glaubersm opened this issue Sep 21, 2020 · 31 comments
Assignees
Labels

Comments

@glaubersm
Copy link

Hi
I use ksnip 1.7.3 on neon unstable based on ubuntu 20.04.
ksnip is unable to take screenshot on Wayland session, I get a notification saying:
"The image could not be displayed. No image provided, but one was expected;"
Tested .deb and appimage packages.

@DamirPorobic
Copy link
Member

Hello, has this worked before? I'll have a look into it this week.

@glaubersm
Copy link
Author

glaubersm commented Sep 21, 2020

I do not know if this issue is a regression or not. I had never tried to take screenshot on Wayland before.

@DamirPorobic
Copy link
Member

I'll have a look into this soon hopefully. Meanwhile you could checkout latest continuous build that supports Generic Wayland Screenshots. Under KDE Plasma you will need to enabled the Force Generic Wayland Screenshot under Settings > Image Grabber. Maybe this works as a workaround for now.

@glaubersm
Copy link
Author

Generic mode does not work on my system too.

@DamirPorobic
Copy link
Member

That's strange. You using Plasma (Wayland) or Plasma (Full Wayland)?

@glaubersm
Copy link
Author

glaubersm commented Oct 6, 2020

My login manager has "Plasma" and "Plasma (Wayland)" options. I use "Plasma (Wayland)".

@DamirPorobic DamirPorobic self-assigned this Oct 11, 2020
@DamirPorobic
Copy link
Member

Tested now ksnip latest AppImage with KDE neon 5.19.5, both the KDE Specific and Generic Wayland, both work.

Can you tell me the exact version you're using?

@glaubersm
Copy link
Author

Tested now appimage version 1.7.3 and got the same result.

@DamirPorobic
Copy link
Member

DamirPorobic commented Oct 11, 2020 via email

@glaubersm
Copy link
Author

glaubersm commented Oct 11, 2020

I use neon unstable edition. I have another computer runnng Arch Linux + KDE Plasma 5.20 beta, I have just tested the same appimage there and got the same result.
EDIT: continuous build of ksnip 1.8.0 also gives me the error message.

@DamirPorobic
Copy link
Member

Ok, might be something with the latest KDE Plasma release. I'll try setting up my test notebook with KDE Neon Unstable. It's this one:
image

@DamirPorobic
Copy link
Member

DamirPorobic commented Oct 14, 2020

I was able to reproduce the issue with KDE Neon Unstable. It looks like a change in KDE Plasma (>5.80) that requires now processes to be authorized to take screenshots. I'm checking with the KDE developers what's this all about an how to get authorized.

@DamirPorobic
Copy link
Member

DamirPorobic commented Oct 28, 2020

While I'm still checking with the KDE folks for a solution, there seems to be a workaround for the generic screenshots using XDG Portal. Adding X-KDE-DBUS-Restricted-Interfaces=org.kde.kwin.Screenshot to /usr/share/applications/org.freedesktop.impl.portal.desktop.kde.desktop and then restarting, makes the Generic Screenshots work again.

@DamirPorobic DamirPorobic changed the title Unable to take screenshot on Wayland session of KDE Plasma Unable to take screenshot on Wayland session of KDE Plasma >5.80 Oct 28, 2020
DamirPorobic added a commit that referenced this issue Nov 9, 2020
@DamirPorobic
Copy link
Member

I have added an entry to the readme file on how to implement this workaround. In future Plasma releases the portal screenshots should be working again. Nothing to do here for us as the issue is on KDE side.

@seth-seikosoft
Copy link

I recently switched back to wayland on KDE with the 5.24 KDE release and Wayland is WAY more stable. thank goodness. However ksnip is still not working? I've looked at the above file to implement the work around and that file already has that information in there.

I get the same error message as the OP when trying to take a screenshot.

Is there any other workaround for this?

Ksnip Version: 1.9.2

Operating System: Manjaro Linux
KDE Plasma Version: 5.24.2
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Kernel Version: 5.16.11-1-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-9850H CPU @ 2.60GHz
Memory: 31.0 GiB of RAM
Graphics Processor: Quadro T1000/PCIe/SSE2

@DamirPorobic
Copy link
Member

@seth-seikosoft you have enabled the Generic Wayland screenshots in settings?

@seth-seikosoft
Copy link

@DamirPorobic awesome thank you! I didn't see those settings before when I was looking through things. Thank you for the update. I'm now able to take a full screenshot.
The -r, -a, -m options that I was using before are not longer available. I'm guessing that's because of the generic Wayland screenshots support.

Just looking through the readme this morning I see that matrix that lists the available features. Thank you for that information.

When do you think those options will be available under Plasma Wayland?

@DamirPorobic
Copy link
Member

Glad that it's working for you!

When do you think those options will be available under Plasma Wayland?

No idea, it's up to the Plasma, Gnome and Wlroots developer. Wayland has cut us of from taking screenshots, not only ksnip but all external applications (application that don't come directly from Gnome or KDE). There is a request to extend the Portal Interface which is used for taking the generic screenshots with more option that we can use to request a screenshots flatpak/xdg-desktop-portal#649 but no idea when it will be developed yet released.

@seth-seikosoft
Copy link

Glad that it's working for you!

When do you think those options will be available under Plasma Wayland?

No idea, it's up to the Plasma, Gnome and Wlroots developer. Wayland has cut us of from taking screenshots, not only ksnip but all external applications (application that don't come directly from Gnome or KDE). There is a request to extend the Portal Interface which is used for taking the generic screenshots with more option that we can use to request a screenshots flatpak/xdg-desktop-portal#649 but no idea when it will be developed yet released.

ok That's a real bummer!

Thank you very much for your quick replies to my questions. Thank you also for all the hard work that you and the rest of the contributers do on this project!

Have a great rest of your week and a great weekend :D

@sniff122
Copy link

sniff122 commented Sep 6, 2022

ik this issue is like 2 years old and closed but i appear to be having this exact same issue on ubuntu 22.04.1 with KDE plasma 5.24.6 on wayland, it appears i already have the workaround of X-KDE-DBUS-Restricted-Interfaces=org.kde.kwin.Screenshot in /usr/share/applications/org.freedesktop.impl.portal.desktop.kde.desktop, dont remember adding that in there though and in the image grabber settings, the Force Generic Wayland Screenshot option is checked, not sure what else i can really try to troubleshoot whats going on tbh, any help will be appreciated!

@DamirPorobic
Copy link
Member

Hi @sniff122, can you describe what issue you are facing? The workaround mentioned was probably just temporarily as KDE and Gnome are moving in direction portal screenshots and this loop hole that KDE left for using the old approach might have been closed meanwhile. One hope for usability improvement is that flatpak extended the interface for portal screenshots so we might be able to only one give screenshot permission and then as in the past, tell the interface what kind of screenshot we want, directly from code, without bothering the user. But this has just landed in flatpak upstream and might take some time before it reaches downstreams.

Anyways, with the generic wayland screenshots you should get some kind of dialog box after triggering a screenshot where you can select what kind of screenshot you want, do get that?

@sniff122
Copy link

sniff122 commented Sep 7, 2022

Anyways, with the generic wayland screenshots you should get some kind of dialog box after triggering a screenshot where you can select what kind of screenshot you want, do get that?

I don't, all I get is the notification from ksnip that was stated in the initial post of this thread (The image could not be displayed. No image provided, but one was expected), it also gets printed to the console but no other errors are logged to the console

@DamirPorobic
Copy link
Member

What ksnip version do you have? How did you install ksnip?

@sniff122
Copy link

sniff122 commented Sep 7, 2022

So far I have tried the version from apt (can't remember what version it is) and also the latest deb package from releases

@DamirPorobic
Copy link
Member

Can you try the AppImage from here? https://github.com/ksnip/ksnip/releases/tag/v1.10.0
The deb version is a bit problematic because it's clashing with Spectacle and it will be discontinued in near future.

@sniff122
Copy link

sniff122 commented Sep 7, 2022

Ahhh alright, I'll let you know how the appimage goes

@DamirPorobic
Copy link
Member

One mor ething, the 1.10.0 version should have some additional debug options that you can enable via Options > Settings > Application Enable Debugging. Try enabling this, then restart ksnip from console and try taking a screenshot. Share you command line outputs here.

@sniff122
Copy link

sniff122 commented Sep 7, 2022

looks like the appimage has just worked straight out of the box

@DamirPorobic
Copy link
Member

AppImage ftw!

@sniff122
Copy link

sniff122 commented Sep 7, 2022

haha yup, i absolutely hate snaps too, why canonical is pushing those so hard on the desktop i have no clue

@Gammelstulle
Copy link

aaaaaaaand... also the appimage is not working now.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
Qt: 5.15.8
KDE Frameworks: 5.103.0
kf5-config: 1.0
Wayland

.deb (from releases here) as well as the flatpak also not work. Also not the prerelease (I hoped)
Tryed any mention option here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants