From 640ca57c347804fed5fb4287d59cff78ab450cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 7 Jul 2022 17:53:39 +0200 Subject: [PATCH] window: Close window when unsetting transient_for Since b443bd42ac, we unmanage a wayland window when clearing its transient parent. That's to make sure that xdg-foreign doesn't leave the dialog around after the imported surface was destroyed. While that behavior is sound, it is problematic to implement it by unmanaging the window, as that happens entirely behind the client's back. Instead, send a close event for the window. Unless the client has good reasons, it should honor the request. (And if it has good reasons - like unsaved work - then effectively hiding the window from both the user and client is probably not the best idea anyway). https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5458 Part-of: --- src/core/window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/window.c b/src/core/window.c index 258dc1f9a..98306291c 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -7943,9 +7943,10 @@ meta_window_set_transient_for (MetaWindow *window, timestamp = meta_display_get_current_time_roundtrip (window->display); - meta_window_unmanage (window, timestamp); + meta_window_delete (window, timestamp); return; } + /* We know this won't create a reference cycle because we check for loops */ g_clear_object (&window->transient_for); window->transient_for = parent ? g_object_ref (parent) : NULL;