xserver: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 19 07:31:35 UTC 2022


 hw/xwayland/xwayland-window.c |   16 +++++++++++++---
 meson.build                   |    2 +-
 2 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 395c25f18520a6d2e3895f59b9e2feaf97ff7635
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Tue Oct 18 11:12:59 2022 +0200

    build: Bump wayland requirement to 1.18
    
    Xwayland uses API such as wl_proxy_set_tag()/wl_proxy_get_tag() which
    appeared in Wayland 1.18, but the build system still requires Wayland
    1.5 at least.
    
    Bump the Wayland version to match the requirements.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

diff --git a/meson.build b/meson.build
index 2498025a2..47ecb06c9 100644
--- a/meson.build
+++ b/meson.build
@@ -63,7 +63,7 @@ add_project_arguments(common_wflags, language : ['c', 'objc'])
 libdrm_req = '>= 2.4.89'
 libselinux_req = '>= 2.0.86'
 xext_req = '>= 1.0.99.4'
-wayland_req = '>= 1.5.0'
+wayland_req = '>= 1.18.0'
 wayland_protocols_req = '>= 1.22'
 gbm_req = '>= 10.2'
 xf86dgaproto_req = '>= 2.0.99.1'
commit a1d14aa8c5afbae2f99aa68454d429aed5852b72
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Mon Oct 17 16:39:30 2022 +0200

    xwayland: Clear the "xwl-window" tag on unrealize
    
    Now that we keep the Wayland surface around for longer than the
    xwl_window, we might get events for that surface after the X11 window
    is unrealized.
    
    Make sure we untag the Wayland surface when the Wayland surface is
    delayed, to break the wl_surface/xwl_window relationship, so that events
    for that surface are discarded by Xwayland.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>
    Fixes: e37f18ee9 - xwayland: Delay wl_surface destruction

diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c
index 549de18eb..2a88c89ea 100644
--- a/hw/xwayland/xwayland-window.c
+++ b/hw/xwayland/xwayland-window.c
@@ -121,6 +121,12 @@ xwl_window_set_xwayland_tag(struct xwl_window *xwl_window)
     wl_proxy_set_tag((struct wl_proxy *)xwl_window->surface, &xwl_surface_tag);
 }
 
+static void
+xwl_window_clear_xwayland_tag(struct xwl_window *xwl_window)
+{
+    wl_proxy_set_tag((struct wl_proxy *)xwl_window->surface, NULL);
+}
+
 Bool
 is_surface_from_xwl_window(struct wl_surface *surface)
 {
@@ -893,9 +899,13 @@ release_wl_surface_for_window(struct xwl_window *xwl_window)
         return;
     }
 
-    /* Otherwise, schedule the destruction later, to mitigate the race
-     * between X11 and Wayland processing so that the compositor has the
-     * time to establish the association before the wl_surface is destroyed.
+    /* Break the wl_surface / xwl_window relationship */
+    wl_surface_set_user_data(xwl_window->surface, NULL);
+    xwl_window_clear_xwayland_tag(xwl_window);
+
+    /* Schedule the destruction later, to mitigate the race between X11
+     * and Wayland processing so that the compositor has the time to
+     * establish the association before the wl_surface is destroyed.
      */
     xwl_wl_surface = xnfcalloc(1, sizeof *xwl_wl_surface);
     xwl_wl_surface->wl_surface = xwl_window->surface;


More information about the xorg-commit mailing list