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.
This commit is contained in:
Florian Müllner 2014-06-24 01:45:15 +02:00
parent 555e2f6de2
commit 048ba353c4

View File

@ -1275,6 +1275,12 @@ meta_window_unmanage (MetaWindow *window,
g_list_free (attached_children); 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) if (window->fullscreen)
{ {
MetaGroup *group; MetaGroup *group;
@ -1405,6 +1411,7 @@ should_be_on_all_workspaces (MetaWindow *window)
window->on_all_workspaces_requested || window->on_all_workspaces_requested ||
window->override_redirect || window->override_redirect ||
(meta_prefs_get_workspaces_only_on_primary () && (meta_prefs_get_workspaces_only_on_primary () &&
!window->unmanaging &&
!meta_window_is_on_primary_monitor (window)); !meta_window_is_on_primary_monitor (window));
} }