From 048ba353c407c1a77703b3fa99daf9101610a942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 24 Jun 2014 01:45:15 +0200 Subject: [PATCH] window: Don't make windows on non-primaries sticky on restart When workspaces-only-on-primary is set, a window can be on all workspaces either because it is on a non-primary workspace, or because it was explicitly made sticky. Only the latter is reflected in _NET_WM_STATE, but both will result in a "magic" _NET_WM_DESKTOP, which we (and probably other WMs) use to set the initial sticky state. So to avoid confusing other WMs (or ourselves), make sure to only have _NET_WM_STATE_STICKY reflected in _NET_WM_DESKTOP when unmanaging. --- src/core/window.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/window.c b/src/core/window.c index 59efbba6d..963a5ffde 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -1275,6 +1275,12 @@ meta_window_unmanage (MetaWindow *window, g_list_free (attached_children); } + /* Make sure to only show window on all workspaces if requested, to + * not confuse other window managers that may take over + */ + if (window->screen->closing && meta_prefs_get_workspaces_only_on_primary ()) + meta_window_update_on_all_workspaces (window); + if (window->fullscreen) { MetaGroup *group; @@ -1405,6 +1411,7 @@ should_be_on_all_workspaces (MetaWindow *window) window->on_all_workspaces_requested || window->override_redirect || (meta_prefs_get_workspaces_only_on_primary () && + !window->unmanaging && !meta_window_is_on_primary_monitor (window)); }