xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Mar 11 14:43:25 UTC 2022


 hw/xwayland/xwayland-window.c |   19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

New commits:
commit 47d33174646a6397284f3483f9102608f5508454
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Mon Feb 21 10:20:09 2022 +0100

    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 at redhat.com>
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

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 ?


More information about the xorg-commit mailing list