[PATCH xserver] xwayland: place a manual redirect on windows

Olivier Fourdan ofourdan at redhat.com
Thu Jan 25 12:43:09 UTC 2018


Place a manual redirect on windows on xwl_realize_window() and remove
it on xwl_unrealize_window() to avoid the X11 window manager removing
its redirect before Xwayland has unrealized the window (e.g. if the X11
window manager has terminated unexpectedly)

Suggested by Daniel Stone <daniel at fooishbar.org>

Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
---
 R-b was given by Daniel on irc on #wayland.

 This goes along with the other patch:
 https://patchwork.freedesktop.org/patch/200439/

 hw/xwayland/xwayland.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 88d31f80b..19aa14a47 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -32,6 +32,7 @@
 #include <micmap.h>
 #include <misyncshm.h>
 #include <compositeext.h>
+#include <compint.h>
 #include <glx_extinit.h>
 #include <os.h>
 #include <xserver_poll.h>
@@ -528,6 +529,8 @@ xwl_realize_window(WindowPtr window)
         goto err_surf;
     }
 
+    compRedirectWindow(serverClient, window, CompositeRedirectManual);
+
     DamageRegister(&window->drawable, xwl_window->damage);
     DamageSetReportAfterOp(xwl_window->damage, TRUE);
 
@@ -575,6 +578,8 @@ xwl_unrealize_window(WindowPtr window)
         xwl_seat_clear_touch(xwl_seat, window);
     }
 
+    compUnredirectWindow(serverClient, window, CompositeRedirectManual);
+
     screen->UnrealizeWindow = xwl_screen->UnrealizeWindow;
     ret = (*screen->UnrealizeWindow) (window);
     xwl_screen->UnrealizeWindow = screen->UnrealizeWindow;
-- 
2.14.3



More information about the xorg-devel mailing list