Bug 99318 - xwayland lets apps see the whole screen
Summary: xwayland lets apps see the whole screen
Alias: None
Product: Wayland
Classification: Unclassified
Component: XWayland (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium major
Assignee: Wayland bug list
QA Contact: Xorg Project Team
Depends on:
Reported: 2017-01-08 02:41 UTC by pixelfairy
Modified: 2017-01-10 02:34 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Description pixelfairy 2017-01-08 02:41:31 UTC
when the xwayland module is loaded, any app can call x11 to see the whole screen, not just its own windows. 

to see this, run "xwd -root > root.xwd" and open with gimp.

can this be fixed so x11 can only see other x11 apps?
Comment 1 Pekka Paalanen 2017-01-08 10:32:55 UTC
Which compositor did you test this on?

According to my understanding of how Xwayland works, Xwayland never has access to the whole screen, unless that whole screen is made of X11 windows. We do not have a mechanism to forward native Wayland window contents to Xwayland and to X11 apps AFAIK, unless the compositor goes out of its way to push the composited image back to Xwayland as well as to screen.

Someone might argue, that X11 screen capturing should continue to work with Xwayland, catching also Wayland apps, so maybe they did it on purpose?

On Weston, X11 apps should not see any Wayland windows ever. It'll be a while before I can test myself, though.
Comment 2 Jonas Ådahl 2017-01-09 02:47:01 UTC
Tried this in both mutter and weston and all I get is

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  73 (X_GetImage)
  Serial number of failed request:  810
  Current serial number in output stream:  810

and an empty 'root.xwd'.
Comment 3 pixelfairy 2017-01-10 02:34:45 UTC
whatevers default in fedora25. it looked like gnome-shell in pstree. 

the last update seems to have fixed it. what i didnt mention in the last report was a black border around all windows. if your curious, i saved that window dump, but now im also getting the failed request. so its good now :)

the fix still allows xwd without -root, and only works on x11 windows. would have preferred no such functionality, but i guess its a compromise.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.