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 <kai1.liu@intel.com>
(cherry picked from commit b468687dd2)
This commit is contained in:
Liu, Kai1 2023-05-30 11:10:28 +08:00 committed by Marius Vlad
parent a5d52075a0
commit 38eb0a96e0
1 changed files with 3 additions and 1 deletions

View File

@ -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,