[mutter] window: Close window when unsetting transient_for



commit 640ca57c347804fed5fb4287d59cff78ab450cf1
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Jul 7 17:53:39 2022 +0200

    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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2499>

 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 258dc1f9af..98306291c9 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]