diff --git a/src/tests/meson.build b/src/tests/meson.build index dafe67ff8..f5a132f6b 100644 --- a/src/tests/meson.build +++ b/src/tests/meson.build @@ -131,6 +131,7 @@ stacking_tests = [ 'mixed-windows', 'set-parent', 'override-redirect', + 'set-override-redirect-parent', 'set-parent-exported', ] diff --git a/src/tests/stacking/set-override-redirect-parent.metatest b/src/tests/stacking/set-override-redirect-parent.metatest new file mode 100644 index 000000000..fc99e4818 --- /dev/null +++ b/src/tests/stacking/set-override-redirect-parent.metatest @@ -0,0 +1,24 @@ +new_client 1 x11 +create 1/1 override +show 1/1 + +create 1/2 +set_parent 1/2 1 +show 1/2 + +create 1/3 +set_parent 1/3 2 +show 1/3 + + +new_client 2 x11 +create 2/1 +show 2/1 + +create 2/2 override +set_parent 2/2 1 +show 2/2 + +create 2/3 +set_parent 2/3 2 +show 2/3 diff --git a/src/x11/window-props.c b/src/x11/window-props.c index 2564909a9..e1e96e0e3 100644 --- a/src/x11/window-props.c +++ b/src/x11/window-props.c @@ -1661,6 +1661,15 @@ reload_transient_for (MetaWindow *window, transient_for, window->desc); transient_for = None; } + else if (parent->override_redirect) + { + meta_warning ("WM_TRANSIENT_FOR window %s for top-level %s is an " + "override-redirect window and this is not correct " + "according to the standard, so we'll fallback to " + "the root window.\n", parent->desc, window->desc); + transient_for = parent->display->x11_display->xroot; + parent = NULL; + } /* Make sure there is not a loop */ if (check_xtransient_for_loop (window, parent))