summaryrefslogtreecommitdiff
path: root/hw/xwayland/xwayland-window.c
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2022-02-21 10:20:09 +0100
committerOlivier Fourdan <ofourdan@redhat.com>2022-03-08 16:43:01 +0100
commit47d33174646a6397284f3483f9102608f5508454 (patch)
tree9cba45158a3277f5b84837ea449c1774f2bfd980 /hw/xwayland/xwayland-window.c
parent7d2014e7d523e10623203582b9f573303750f087 (diff)
downloadxserver-47d33174646a6397284f3483f9102608f5508454.tar.gz
Xwayland: Do not map the COW by default when rootless
The composite overlay window (COW) can be queried from any X11 client, not just the X11 compositing manager. If a client tries to get the composite overlay window, the Xserver will map the window and block all pointer events (the window being mapped and on top of the stack). To avoid that issue, unset the "mapped" state of the composite overlay window once realized when Xwayland is running rootless. Note: All Xservers are actually affected by this issue, but with most regular X servers, the compositing manager will take care of dealing with the composite overlay window, and an X11 client using GetOverlayWindow() won't break pointer events for all X11 clients. Wayland compositors however usually run Xwayland rootless and have no use for the COW. v2: Avoid registering damage for the COW (Michel) v3: Remove the "mapped" test to avoid calling register_damage() if the COW is not mapped (Michel) Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1314 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Diffstat (limited to 'hw/xwayland/xwayland-window.c')
-rw-r--r--hw/xwayland/xwayland-window.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c
index 00f161eda..152b4d0a6 100644
--- a/hw/xwayland/xwayland-window.c
+++ b/hw/xwayland/xwayland-window.c
@@ -522,6 +522,7 @@ Bool
xwl_realize_window(WindowPtr window)
{
ScreenPtr screen = window->drawable.pScreen;
+ CompScreenPtr comp_screen = GetCompScreen(screen);
struct xwl_screen *xwl_screen;
Bool ret;
@@ -535,12 +536,20 @@ xwl_realize_window(WindowPtr window)
if (!ret)
return FALSE;
- if (xwl_screen->rootless && !window->parent) {
- BoxRec box = { 0, 0, xwl_screen->width, xwl_screen->height };
+ if (xwl_screen->rootless) {
+ /* We do not want the COW to be mapped when rootless in Xwayland */
+ if (window == comp_screen->pOverlayWin) {
+ window->mapped = FALSE;
+ return TRUE;
+ }
- RegionReset(&window->winSize, &box);
- RegionNull(&window->clipList);
- RegionNull(&window->borderClip);
+ if (!window->parent) {
+ BoxRec box = { 0, 0, xwl_screen->width, xwl_screen->height };
+
+ RegionReset(&window->winSize, &box);
+ RegionNull(&window->clipList);
+ RegionNull(&window->borderClip);
+ }
}
if (xwl_screen->rootless ?