[mutter/cherry-pick-e38db123] window: Don't change workspaces of unmanaged windows




commit d2655b8c04a8e112b8c55a0b54aaf598ac3166eb
Author: Sebastian Keller <skeller gnome org>
Date:   Thu Sep 16 19:58:57 2021 +0200

    window: Don't change workspaces of unmanaged windows
    
    If the ancestor a window is transient for has already been unmanaged
    when the window is activated via meta_window_activate_full while its
    transient_for property still points to that ancestor, this will cause
    the already unmanaged ancestor to get added to the windows workspace.
    This is after the ancestor had its workspace set to NULL when it was
    unmanaged, causing this to look like an actual workspace change. Once
    the window has been added to the workspace, it will never be removed
    again, because the it has already been unmanaged. This confuses things
    like the shell window tracker and leads to phantom windows being
    considered present for apps that are not even running anymore.
    
    Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4184
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2003>
    
    
    (cherry picked from commit e38db1237db9a6135507ba5074063ff34958321e)

 src/core/window.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/core/window.c b/src/core/window.c
index ea56f33283..c0437eea72 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -4972,6 +4972,9 @@ static void
 meta_window_change_workspace_without_transients (MetaWindow    *window,
                                                  MetaWorkspace *workspace)
 {
+  if (window->unmanaging)
+    return;
+
   /* Try to unstick the window if it's stuck. This doesn't
    * have any guarantee that we'll actually unstick the
    * window, since it could be stuck for other reasons. */


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