From 5e5480e620ed5b307902d913f89f5937cc01a28f Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Tue, 26 Apr 2022 19:30:00 +0200 Subject: [PATCH] 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: --- 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 4e8efcd75..617a1dfaa 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);