From a0e6fba6b144ec67b780d09f9bf54ad849bcc695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 6 Jan 2026 08:44:11 -0800 Subject: [PATCH 1/2] ShellClientsManager: centered windows are not always shell windows --- .../ShellClients/ShellClientsManager.vala | 24 ++++++++++++++----- compositor/ShellClients/ShellWindow.vala | 8 +++++++ compositor/WindowManager.vala | 4 ++-- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/compositor/ShellClients/ShellClientsManager.vala b/compositor/ShellClients/ShellClientsManager.vala index 7172e1b0..9e5406c2 100644 --- a/compositor/ShellClients/ShellClientsManager.vala +++ b/compositor/ShellClients/ShellClientsManager.vala @@ -182,21 +182,33 @@ public class GreeterCompositor.ShellClientsManager : Object { window.unmanaging.connect_after ((_window) => positioned_windows.remove (_window)); } - public void make_centered (Meta.Window window) requires (!is_itself_positioned (window)) { + public void make_centered (Meta.Window window) requires (!is_itself_shell_window (window)) { positioned_windows[window] = new ShellWindow (window, CENTER); // connect_after so we make sure that any queued move is unqueued window.unmanaging.connect_after ((_window) => positioned_windows.remove (_window)); } - public bool is_itself_positioned (Meta.Window window) { - return (window in positioned_windows) || (window in panel_windows) || NotificationStack.is_notification (window); + public bool is_itself_shell_window (Meta.Window window) { + return ( + (window in positioned_windows && positioned_windows[window].modal) || + (window in panel_windows) || + NotificationStack.is_notification (window) + ); } - public bool is_positioned_window (Meta.Window window) { - bool positioned = is_itself_positioned (window); + /** + * Whether the given window is a shell window. A shell window is a window that's + * part of the desktop shell itself and should be completely ignored by other components. + * It is entirely managed by Gala, always above everything else, and manages hiding + * in e.g. multitasking view itself. This also applies to transient windows of shell windows. + * Note that even if `false` is returned the window might still be in part managed by gala + * e.g. for centered windows. + */ + public bool is_shell_window (Meta.Window window) { + bool positioned = is_itself_shell_window (window); window.foreach_ancestor ((ancestor) => { - if (is_itself_positioned (ancestor)) { + if (is_itself_shell_window (ancestor)) { positioned = true; } diff --git a/compositor/ShellClients/ShellWindow.vala b/compositor/ShellClients/ShellWindow.vala index 99555ffb..c6de3405 100644 --- a/compositor/ShellClients/ShellWindow.vala +++ b/compositor/ShellClients/ShellWindow.vala @@ -6,6 +6,9 @@ */ public class GreeterCompositor.ShellWindow : PositionedWindow { + public bool modal { get; private set; default = false; } + public bool dim { get; private set; default = false; } + public Clutter.Actor? actor { get { return window_actor; } } private Meta.WindowActor window_actor; @@ -23,6 +26,11 @@ public class GreeterCompositor.ShellWindow : PositionedWindow { notify["position"].connect (update_clip); } + public void make_modal (bool dim) { + modal = true; + this.dim = dim; + } + private void update_clip () { if (position != TOP && position != BOTTOM) { window_actor.remove_clip (); diff --git a/compositor/WindowManager.vala b/compositor/WindowManager.vala index 396d3313..9e08f3c6 100644 --- a/compositor/WindowManager.vala +++ b/compositor/WindowManager.vala @@ -31,7 +31,7 @@ namespace GreeterCompositor { /** * The group that contains all WindowActors that make shell elements, that is all windows reported as - * ShellClientsManager.is_positioned_window. + * ShellClientsManager.is_shell_window. * It will (eventually) never be hidden by other components and is always on top of everything. Therefore elements are * responsible themselves for hiding depending on the state we are currently in (e.g. normal desktop, open multitasking view, fullscreen, etc.). */ @@ -309,7 +309,7 @@ namespace GreeterCompositor { private void check_shell_window (Meta.WindowActor actor) { unowned var window = actor.get_meta_window (); - if (ShellClientsManager.get_instance ().is_positioned_window (window)) { + if (ShellClientsManager.get_instance ().is_shell_window (window)) { Utils.clutter_actor_reparent (actor, shell_group); } From 9804155a14d3acc6df680edb6bed570cc84e52e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 6 Jan 2026 12:59:43 -0800 Subject: [PATCH 2/2] Remove positioned window line --- compositor/ShellClients/ShellClientsManager.vala | 1 - compositor/ShellClients/ShellWindow.vala | 8 -------- 2 files changed, 9 deletions(-) diff --git a/compositor/ShellClients/ShellClientsManager.vala b/compositor/ShellClients/ShellClientsManager.vala index 9e5406c2..fe8ce2c3 100644 --- a/compositor/ShellClients/ShellClientsManager.vala +++ b/compositor/ShellClients/ShellClientsManager.vala @@ -191,7 +191,6 @@ public class GreeterCompositor.ShellClientsManager : Object { public bool is_itself_shell_window (Meta.Window window) { return ( - (window in positioned_windows && positioned_windows[window].modal) || (window in panel_windows) || NotificationStack.is_notification (window) ); diff --git a/compositor/ShellClients/ShellWindow.vala b/compositor/ShellClients/ShellWindow.vala index c6de3405..99555ffb 100644 --- a/compositor/ShellClients/ShellWindow.vala +++ b/compositor/ShellClients/ShellWindow.vala @@ -6,9 +6,6 @@ */ public class GreeterCompositor.ShellWindow : PositionedWindow { - public bool modal { get; private set; default = false; } - public bool dim { get; private set; default = false; } - public Clutter.Actor? actor { get { return window_actor; } } private Meta.WindowActor window_actor; @@ -26,11 +23,6 @@ public class GreeterCompositor.ShellWindow : PositionedWindow { notify["position"].connect (update_clip); } - public void make_modal (bool dim) { - modal = true; - this.dim = dim; - } - private void update_clip () { if (position != TOP && position != BOTTOM) { window_actor.remove_clip ();