From 38eb0a96e01d394fb8f06d4f016f8cc72ea703fa Mon Sep 17 00:00:00 2001 From: "Liu, Kai1" Date: Tue, 30 May 2023 11:10:28 +0800 Subject: [PATCH] xwm: WM_TRANSIENT_FOR should not point to override-redirect window The override-redirect window will not be assigned a shell_surface object. If it is used as a parent window, it will cause a crash when calling the set_parent function. The EWMH specification does not describe the behavior of an override-redirect window as a parent window, so we should ignore this case. Signed-off-by: Liu, Kai1 (cherry picked from commit b468687dd2663240d1613bf4a917f049ef09af46) --- xwayland/window-manager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 71c63caf..aa3edab3 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -3048,7 +3048,9 @@ xserver_map_shell_surface(struct weston_wm_window *window, } else if (window->override_redirect) { xwayland_interface->set_xwayland(window->shsurf, window->x, window->y); - } else if (window->transient_for && window->transient_for->surface) { + } else if (window->transient_for && + !window->transient_for->override_redirect && + window->transient_for->surface) { parent = window->transient_for; if (weston_wm_window_type_inactive(window)) { xwayland_interface->set_transient(window->shsurf,