Skip to content

Commit 9808eb9

Browse files
authored
ShellClientsManager: centered windows are not always shell windows (#851)
* ShellClientsManager: centered windows are not always shell windows * Remove positioned window line
1 parent a1d447a commit 9808eb9

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

compositor/ShellClients/ShellClientsManager.vala

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,32 @@ public class GreeterCompositor.ShellClientsManager : Object {
182182
window.unmanaging.connect_after ((_window) => positioned_windows.remove (_window));
183183
}
184184

185-
public void make_centered (Meta.Window window) requires (!is_itself_positioned (window)) {
185+
public void make_centered (Meta.Window window) requires (!is_itself_shell_window (window)) {
186186
positioned_windows[window] = new ShellWindow (window, CENTER);
187187

188188
// connect_after so we make sure that any queued move is unqueued
189189
window.unmanaging.connect_after ((_window) => positioned_windows.remove (_window));
190190
}
191191

192-
public bool is_itself_positioned (Meta.Window window) {
193-
return (window in positioned_windows) || (window in panel_windows) || NotificationStack.is_notification (window);
192+
public bool is_itself_shell_window (Meta.Window window) {
193+
return (
194+
(window in panel_windows) ||
195+
NotificationStack.is_notification (window)
196+
);
194197
}
195198

196-
public bool is_positioned_window (Meta.Window window) {
197-
bool positioned = is_itself_positioned (window);
199+
/**
200+
* Whether the given window is a shell window. A shell window is a window that's
201+
* part of the desktop shell itself and should be completely ignored by other components.
202+
* It is entirely managed by Gala, always above everything else, and manages hiding
203+
* in e.g. multitasking view itself. This also applies to transient windows of shell windows.
204+
* Note that even if `false` is returned the window might still be in part managed by gala
205+
* e.g. for centered windows.
206+
*/
207+
public bool is_shell_window (Meta.Window window) {
208+
bool positioned = is_itself_shell_window (window);
198209
window.foreach_ancestor ((ancestor) => {
199-
if (is_itself_positioned (ancestor)) {
210+
if (is_itself_shell_window (ancestor)) {
200211
positioned = true;
201212
}
202213

compositor/WindowManager.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace GreeterCompositor {
3131

3232
/**
3333
* The group that contains all WindowActors that make shell elements, that is all windows reported as
34-
* ShellClientsManager.is_positioned_window.
34+
* ShellClientsManager.is_shell_window.
3535
* It will (eventually) never be hidden by other components and is always on top of everything. Therefore elements are
3636
* responsible themselves for hiding depending on the state we are currently in (e.g. normal desktop, open multitasking view, fullscreen, etc.).
3737
*/
@@ -309,7 +309,7 @@ namespace GreeterCompositor {
309309

310310
private void check_shell_window (Meta.WindowActor actor) {
311311
unowned var window = actor.get_meta_window ();
312-
if (ShellClientsManager.get_instance ().is_positioned_window (window)) {
312+
if (ShellClientsManager.get_instance ().is_shell_window (window)) {
313313
Utils.clutter_actor_reparent (actor, shell_group);
314314
}
315315

0 commit comments

Comments
 (0)