Skip to content

Commit e2da1bb

Browse files
authored
ShellClients: Don't declare centered windows as shell windows (#2709)
1 parent 505e1f3 commit e2da1bb

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

src/Dialogs/InhibitShortcutsDialog.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class Gala.InhibitShortcutsDialog : AccessDialog, Meta.InhibitShortcutsDi
3636
}
3737

3838
if (app.id == "io.elementary.settings.desktop" || // Naive check to always allow inhibiting by our settings app. This is needed for setting custom shortcuts
39-
ShellClientsManager.get_instance ().is_positioned_window (window) // Certain windows (e.g. centered ones) may want to disable move via super + drag
39+
ShellClientsManager.get_instance ().is_shell_window (window) // Certain windows (e.g. centered ones) may want to disable move via super + drag
4040
) {
4141
on_response (0);
4242
return;

src/ShellClients/ShellClientsManager.vala

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
233233
panel_windows[window].request_visible_in_multitasking_view ();
234234
}
235235

236-
public void make_centered (Meta.Window window) requires (!is_itself_positioned (window)) {
236+
public void make_centered (Meta.Window window) requires (!is_itself_shell_window (window)) {
237237
positioned_windows[window] = new ExtendedBehaviorWindow (window);
238238

239239
// connect_after so we make sure that any queued move is unqueued
@@ -254,14 +254,26 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
254254
}
255255
}
256256

257-
public bool is_itself_positioned (Meta.Window window) {
258-
return (window in positioned_windows) || (window in panel_windows) || NotificationStack.is_notification (window);
257+
public bool is_itself_shell_window (Meta.Window window) {
258+
return (
259+
(window in positioned_windows && positioned_windows[window].modal) ||
260+
(window in panel_windows) ||
261+
NotificationStack.is_notification (window)
262+
);
259263
}
260264

261-
public bool is_positioned_window (Meta.Window window) {
262-
bool positioned = is_itself_positioned (window);
265+
/**
266+
* Whether the given window is a shell window. A shell window is a window that's
267+
* part of the desktop shell itself and should be completely ignored by other components.
268+
* It is entirely managed by Gala, always above everything else, and manages hiding
269+
* in e.g. multitasking view itself. This also applies to transient windows of shell windows.
270+
* Note that even if `false` is returned the window might still be in part managed by gala
271+
* e.g. for centered windows.
272+
*/
273+
public bool is_shell_window (Meta.Window window) {
274+
bool positioned = is_itself_shell_window (window);
263275
window.foreach_ancestor ((ancestor) => {
264-
if (is_itself_positioned (ancestor)) {
276+
if (is_itself_shell_window (ancestor)) {
265277
positioned = true;
266278
}
267279

src/ShellClients/ShellWindow.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public abstract class Gala.ShellWindow : PositionedWindow, GestureTarget {
8585

8686
unowned var manager = ShellClientsManager.get_instance ();
8787
window.foreach_transient ((transient) => {
88-
if (manager.is_itself_positioned (transient)) {
88+
if (manager.is_itself_shell_window (transient)) {
8989
return true;
9090
}
9191

src/Widgets/MultitaskingView/StaticWindowContainer.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public class Gala.StaticWindowContainer : ActorTarget {
7171
}
7272

7373
private void check_window_changed (Meta.Window window) {
74-
var is_static = is_static (window) && !ShellClientsManager.get_instance ().is_positioned_window (window);
74+
var is_static = is_static (window) && !ShellClientsManager.get_instance ().is_shell_window (window);
7575

7676
Clutter.Actor? clone = null;
7777
for (var child = get_first_child (); child != null; child = child.get_next_sibling ()) {

src/WindowManager.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace Gala {
4343

4444
/**
4545
* The group that contains all WindowActors that make shell elements, that is all windows reported as
46-
* ShellClientsManager.is_positioned_window.
46+
* ShellClientsManager.is_shell_window.
4747
* It will (eventually) never be hidden by other components and is always on top of everything. Therefore elements are
4848
* responsible themselves for hiding depending on the state we are currently in (e.g. normal desktop, open multitasking view, fullscreen, etc.).
4949
*/
@@ -714,7 +714,7 @@ namespace Gala {
714714
unowned var display = get_display ();
715715

716716
if (!is_modal () || modal_stack.peek_head ().grab != null || display.focus_window == null ||
717-
ShellClientsManager.get_instance ().is_positioned_window (display.focus_window)
717+
ShellClientsManager.get_instance ().is_shell_window (display.focus_window)
718718
) {
719719
return;
720720
}
@@ -1032,7 +1032,7 @@ namespace Gala {
10321032
return;
10331033
}
10341034

1035-
if (ShellClientsManager.get_instance ().is_positioned_window (window)) {
1035+
if (ShellClientsManager.get_instance ().is_shell_window (window)) {
10361036
InternalUtils.clutter_actor_reparent (actor, shell_group);
10371037
}
10381038

0 commit comments

Comments
 (0)