In a kwin_wayland session, ksnapshot is unable to create screenshots on wayland windows. It only works on x11 windows such as firefox or qt4 applications. Reproducible: Always Steps to Reproduce: 1. log in to a kwin_wayland session, see [1] for details 2. open ksnapshot 3. a) try to take a snapshot of a single window 3. b) try to take a snapshot of the whole desktop [1] http://blog.martin-graesslin.com/blog/2016/07/why-does-kwin_wayland-not-start/ Actual Results: a) When trying to take a snapshot of a single window, wayland windows are ignored as if they didn't exist. Only after clicking in a x11 window the screenshot is created b) "whole desktop" screenshots can't be made Expected Results: Take screenshots like on x11: a) take screenshot of any window b) take screenshot of the whole desktop By default, wayland applications don't have any access to other wayland windows and their content. I guess this feature has to be implemented in kwin_wayland itself to work correctly. Installed software verisons: ksnapshot-15.08.3-4.fc24.x86_64 qt5-qtbase-5.6.1-3.fc24.x86_64 kf5-kwindowsystem-5.24.0-1.fc24.x86_64 kwin-wayland-5.7.1-3.fc24.x86_64 libwayland-client-1.10.0-1.fc24.x86_64
Note that ksnapshot has been deprecated for almost an year now. It is no longer developed, and has been replaced by Spectacle in KDE Applications 15.12. That said, Spectacle still doesn't have Wayland support. When Spectacle was first conceived, it was re-architected specifically to make adding Wayland platform support possible. As of now, a generalised Wayland platform API to take screenshots does not exist. gnome-screenshot taps into a DBus API that is provided by Gnome-Shell to take screenshots on Gnome/Wayland. weston-screenshot similarly uses a Weston-specific API. Martin is at a stage with kwin/wayland development that we're ready to add non-essential things to it, such as a screenshot API. We're going to be working on this in the near future, probably at hackathons in Akademy in September. I plan on this being available in Spectacle for the December 2016 release of Applications.
Still doesn't work. I tried to use it to show a font rendering problem on wayland and plasma but not able to do it with spectacle.
Atm which alternative to take snapshots under wayland?
There's no alternatives. Due to Wayland's security model it just doesn't allow applications access to an image of the screen, or of other apps. There's compositor-specific support (such as Gnome-Screenshot working only on Gnome-Shell, Weston-Screenshot working only on Weston and so on).
Thanks to Martin, a few of Spectacle's capture modes now work on Wayland as of 16.12.