From 07f603262700bfe2abcc28f6d7a8e38457d211cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 8 Feb 2024 18:41:25 +0100 Subject: [PATCH] xwayland: Call register_damage depending on ensure_surface_for_window Preparation for next commit. This might change behaviour for non-InputOutput top-level windows. ensure_surface_for_window getting called and returning non-NULL for those would seem like a pre-existing bug though. Part-of: --- hw/xwayland/xwayland-window.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index fdd4b287a..d4e8e81e2 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -1360,18 +1360,14 @@ xwl_realize_window(WindowPtr window) } } - if (xwl_screen->rootless ? - (window->drawable.class == InputOutput && - window->parent == window->drawable.pScreen->root) : - !window->parent) { - if (!register_damage(window)) - return FALSE; - } - xwl_window = ensure_surface_for_window(window); if (!xwl_window) return FALSE; + if (window == xwl_window->toplevel && + !window_get_damage(window)) + return register_damage(window); + return TRUE; }