window: Recalculate attachedness for Wayland window parent changes

When modal dialogs are attached, and we set the parent/transient-for
after setting the modal type, the attachedness isn't updated. This is
(apparently) not the case for X11 windows, as they go through a
unmanage/manage dance avoiding the issue.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
This commit is contained in:
Jonas Ådahl 2023-02-10 16:12:58 +01:00 committed by Marge Bot
parent d870b08580
commit f5176101cd

View File

@ -7364,6 +7364,13 @@ meta_window_set_transient_for (MetaWindow *window,
g_set_object (&window->transient_for, parent);
if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND &&
window->attached != meta_window_should_attach_to_parent (window))
{
window->attached = meta_window_should_attach_to_parent (window);
meta_window_recalc_features (window);
}
/* update stacking constraints */
if (!window->override_redirect)
meta_stack_update_transient (window->display->stack, window);