Bug 365762 - Unable to make snapshot (screenshot) on wayland winodws (kwin_wayland session)
Summary: Unable to make snapshot (screenshot) on wayland winodws (kwin_wayland session)
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR major
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-17 09:02 UTC by Christian Stadelmann
Modified: 2017-02-20 18:18 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Stadelmann 2016-07-17 09:02:15 UTC
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
Comment 1 Boudhayan Gupta 2016-07-17 11:05:15 UTC
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.
Comment 2 humufr 2016-09-16 10:25:08 UTC
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.
Comment 3 dino 2016-10-21 08:15:26 UTC
Atm which alternative to take snapshots under wayland?
Comment 4 Boudhayan Gupta 2016-10-21 10:37:40 UTC
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).
Comment 5 Boudhayan Gupta 2017-02-20 18:18:13 UTC
Thanks to Martin, a few of Spectacle's capture modes now work on Wayland as of 16.12.