mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
window: Make should_be_on_all_workspaces() handle being headless
Also adds a soft assert to meta_window_is_on_primary_monitor() to make it easier to spot when callers might want to handle headless in a certain way. https://bugzilla.gnome.org/show_bug.cgi?id=730551
This commit is contained in:
parent
8493777961
commit
2c85bb4178
@ -2933,6 +2933,8 @@ meta_window_is_monitor_sized (MetaWindow *window)
|
||||
gboolean
|
||||
meta_window_is_on_primary_monitor (MetaWindow *window)
|
||||
{
|
||||
g_return_val_if_fail (window->monitor, FALSE);
|
||||
|
||||
return window->monitor->is_primary;
|
||||
}
|
||||
|
||||
@ -4543,13 +4545,22 @@ set_workspace_state (MetaWindow *window,
|
||||
static gboolean
|
||||
should_be_on_all_workspaces (MetaWindow *window)
|
||||
{
|
||||
return
|
||||
window->always_sticky ||
|
||||
window->on_all_workspaces_requested ||
|
||||
window->override_redirect ||
|
||||
(meta_prefs_get_workspaces_only_on_primary () &&
|
||||
!window->unmanaging &&
|
||||
!meta_window_is_on_primary_monitor (window));
|
||||
if (window->always_sticky)
|
||||
return TRUE;
|
||||
|
||||
if (window->on_all_workspaces_requested)
|
||||
return TRUE;
|
||||
|
||||
if (window->override_redirect)
|
||||
return TRUE;
|
||||
|
||||
if (meta_prefs_get_workspaces_only_on_primary () &&
|
||||
!window->unmanaging &&
|
||||
window->monitor &&
|
||||
!meta_window_is_on_primary_monitor (window))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user