ksnip / ksnip

ksnip the cross-platform screenshot and annotation tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

glaubersm opened this issue · comments

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.

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

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

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.

Generic mode does not work on my system too.

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

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

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?

Tested now appimage version 1.7.3 and got the same result.

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.

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

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.

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.

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.

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

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

@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?

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.

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

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!

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?

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

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

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

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.

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

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.

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

AppImage ftw!

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