@@ -52,13 +52,18 @@ public class GreeterCompositor.ShellClientsManager : Object {
5252 }
5353
5454 public void make_dock (Meta .Window window ) {
55+ #if HAS_MUTTER49
56+ window. set_type (Meta . WindowType . DOCK );
57+ #else
5558 if (Meta . Util . is_wayland_compositor ()) {
5659 make_dock_wayland (window);
5760 } else {
5861 make_dock_x11 (window);
5962 }
63+ #endif
6064 }
6165
66+ #if ! HAS_MUTTER49
6267 private void make_dock_wayland (Meta .Window window ) requires (Meta .Util .is_wayland_compositor ()) {
6368 foreach (var client in protocol_clients) {
6469 if (client. wayland_client. owns_window (window)) {
@@ -88,16 +93,22 @@ public class GreeterCompositor.ShellClientsManager : Object {
8893 // 0 means replace
8994 xdisplay. change_property (x_window, atom, (X . Atom ) 4 , 32 , 0 , (uchar[]) dock_atom, 1 );
9095 }
96+ #endif
9197
9298
9399 public void make_desktop (Meta .Window window ) {
100+ #if HAS_MUTTER49
101+ window. set_type (Meta . WindowType . DESKTOP );
102+ #else
94103 if (Meta . Util . is_wayland_compositor ()) {
95104 make_desktop_wayland (window);
96105 } else {
97106 make_desktop_x11 (window);
98107 }
108+ #endif
99109 }
100110
111+ #if ! HAS_MUTTER49
101112 private void make_desktop_wayland (Meta .Window window ) requires (Meta .Util .is_wayland_compositor ()) {
102113 foreach (var client in protocol_clients) {
103114 if (client. wayland_client. owns_window (window)) {
@@ -125,6 +136,7 @@ public class GreeterCompositor.ShellClientsManager : Object {
125136 // 0 means replace
126137 xdisplay. change_property (x_window, atom, (X . Atom ) 4 , 32 , 0 , (uchar[]) dock_atom, 1 );
127138 }
139+ #endif
128140
129141 public void set_anchor (Meta .Window window , Pantheon .Desktop .Anchor anchor ) {
130142 if (window in panel_windows) {
@@ -170,21 +182,32 @@ public class GreeterCompositor.ShellClientsManager : Object {
170182 window. unmanaging. connect_after ((_window) = > positioned_windows. remove (_window));
171183 }
172184
173- 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 )) {
174186 positioned_windows[window] = new ShellWindow (window, CENTER );
175187
176188 // connect_after so we make sure that any queued move is unqueued
177189 window. unmanaging. connect_after ((_window) = > positioned_windows. remove (_window));
178190 }
179191
180- public bool is_itself_positioned (Meta .Window window ) {
181- 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+ );
182197 }
183198
184- public bool is_positioned_window (Meta .Window window ) {
185- 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);
186209 window. foreach_ancestor ((ancestor) = > {
187- if (is_itself_positioned (ancestor)) {
210+ if (is_itself_shell_window (ancestor)) {
188211 positioned = true ;
189212 }
190213
0 commit comments