From fc8b7d05e74a6351df56ad8b17216aeb0dcc016b Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 25 Jan 2018 13:43:09 +0100 Subject: [PATCH] xwayland: place a manual redirect on windows 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 Signed-off-by: Olivier Fourdan Reviewed-by: Daniel Stone --- 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 #include #include +#include #include #include #include @@ -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;