[mutter] x11/window: Update _NET_WM_DESKTOP when a window becomes all-workspace



commit 5e5480e620ed5b307902d913f89f5937cc01a28f
Author: Sebastian Keller <skeller gnome org>
Date:   Tue Apr 26 19:30:00 2022 +0200

    x11/window: Update _NET_WM_DESKTOP when a window becomes all-workspace
    
    When an X11 window becomes an all-workspace window its `workspace` is
    set to NULL before `meta_window_x11_current_workspace_changed()` is
    called. The latter then checks for `workspace` being NULL (which also
    happens when unmanaging) and then returns early. So this does not update
    `_NET_WM_DESKTOP` to 0xFFFFFFFF. Instead it remains at the workspace the
    window was on before. This was causing programs like `wmctrl` to switch
    to this old workspace when activating such a window.
    
    Fix this by checking if the window is unmanaging instead.
    
    Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2242
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2387>

 src/x11/window-x11.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 4e8efcd75d..617a1dfaa0 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -1308,11 +1308,8 @@ meta_window_x11_current_workspace_changed (MetaWindow *window)
    */
   unsigned long data[1];
 
-  if (window->workspace == NULL)
-    {
-      /* this happens when unmanaging windows */
-      return;
-    }
+  if (window->unmanaging)
+    return;
 
   data[0] = meta_window_get_net_wm_desktop (window);
 


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