@@ -37,7 +37,13 @@ namespace Gala {
3737 */
3838 public Clutter . Actor top_window_group { get ; protected set ; }
3939
40- public Clutter . Actor notification_group { get ; protected set ; }
40+ /**
41+ * The group that contains all WindowActors that make shell elements, that is all windows reported as
42+ * ShellClientsManager.is_positioned_window.
43+ * It will (eventually) never be hidden by other components and is always on top of everything. Therefore elements are
44+ * responsible themselves for hiding depending on the state we are currently in (e.g. normal desktop, open multitasking view, fullscreen, etc.).
45+ */
46+ public Clutter . Actor shell_group { get ; private set ; }
4147
4248 /**
4349 * {@inheritDoc }
@@ -104,8 +110,6 @@ namespace Gala {
104110 private bool animating_switch_workspace = false ;
105111 private bool switch_workspace_with_gesture = false ;
106112
107- private signal void window_created (Meta .Window window );
108-
109113 /**
110114 * Amount of pixels to move on the nudge animation.
111115 */
@@ -253,14 +257,6 @@ namespace Gala {
253257 stage. remove_child (top_window_group);
254258 ui_group. add_child (top_window_group);
255259
256- #if HAS_MUTTER44
257- var feedback_group = display. get_compositor (). get_feedback_group ();
258- #else
259- var feedback_group = display. get_feedback_group ();
260- #endif
261- stage. remove_child (feedback_group);
262- ui_group. add_child (feedback_group);
263-
264260 // Initialize plugins and add default components if no plugin overrides them
265261 unowned var plugin_manager = PluginManager . get_default ();
266262 plugin_manager. initialize (this );
@@ -293,8 +289,16 @@ namespace Gala {
293289 }
294290
295291 // Add the remaining components that should be on top
296- notification_group = new Clutter .Actor ();
297- ui_group. add_child (notification_group);
292+ shell_group = new Clutter .Actor ();
293+ ui_group. add_child (shell_group);
294+
295+ #if HAS_MUTTER44
296+ var feedback_group = display. get_compositor (). get_feedback_group ();
297+ #else
298+ var feedback_group = display. get_feedback_group ();
299+ #endif
300+ stage. remove_child (feedback_group);
301+ ui_group. add_child (feedback_group);
298302
299303 pointer_locator = new PointerLocator (display);
300304 ui_group. add_child (pointer_locator);
@@ -381,12 +385,14 @@ namespace Gala {
381385
382386 update_input_area ();
383387
384- display. window_created. connect ((window) = > window_created (window));
385-
386388 var scroll_action = new SuperScrollAction (display);
387389 scroll_action. triggered. connect (handle_super_scroll);
388390 stage. add_action_full (" wm-super-scroll-action" , CAPTURE , scroll_action);
389391
392+ display. window_created. connect ((window) = >
393+ InternalUtils . wait_for_window_actor_visible (window, check_shell_window)
394+ );
395+
390396 stage. show ();
391397
392398 plugin_manager. load_waiting_plugins ();
@@ -1162,6 +1168,17 @@ namespace Gala {
11621168 show_window_menu (window, menu, rect. x, rect. y);
11631169 }
11641170
1171+ private void check_shell_window (Meta . WindowActor actor) {
1172+ unowned var window = actor. get_meta_window ();
1173+ if (ShellClientsManager . get_instance (). is_positioned_window (window)) {
1174+ InternalUtils . clutter_actor_reparent (actor, shell_group);
1175+ }
1176+
1177+ if (NotificationStack . is_notification (window)) {
1178+ notification_stack. show_notification (actor);
1179+ }
1180+ }
1181+
11651182 /*
11661183 * effects
11671184 */
@@ -1436,12 +1453,8 @@ namespace Gala {
14361453 actor. remove_all_transitions ();
14371454 actor. show ();
14381455
1439- // Notifications are a special case and have to be always be handled
1440- // (also regardless of the animation setting)
1456+ // Notifications initial animation is handled by the notification stack
14411457 if (NotificationStack . is_notification (window)) {
1442- InternalUtils . clutter_actor_reparent (actor, notification_group);
1443- notification_stack. show_notification (actor);
1444-
14451458 map_completed (actor);
14461459 return ;
14471460 }
@@ -1843,7 +1856,6 @@ namespace Gala {
18431856 private List<Clutter . Actor > ? windows;
18441857 private List<Clutter . Actor > ? parents;
18451858 private List<Clutter . Actor > ? tmp_actors;
1846- private ulong switch_workspace_window_created_id = 0 ;
18471859 private Clutter . Actor ? out_group;
18481860 private Clutter . Actor ? in_group;
18491861 private Clutter . Actor ? wallpaper;
@@ -1932,7 +1944,10 @@ namespace Gala {
19321944 continue ;
19331945 }
19341946
1935- if (! window. showing_on_its_workspace () || move_primary_only && ! window. is_on_primary_monitor ()) {
1947+ if (! window. showing_on_its_workspace () ||
1948+ move_primary_only && ! window. is_on_primary_monitor () ||
1949+ actor. get_parent () == shell_group
1950+ ) {
19361951 continue ;
19371952 }
19381953
@@ -2045,17 +2060,6 @@ namespace Gala {
20452060
20462061 prepare_workspace_switch (from, to, direction);
20472062
2048- // while a workspace is being switched mutter doesn't map windows
2049- // TODO: currently only notifications are handled here, other windows should be too
2050- switch_workspace_window_created_id = window_created. connect ((window) = > {
2051- if (NotificationStack . is_notification (window)) {
2052- InternalUtils . wait_for_window_actor_visible (window, (actor) = > {
2053- InternalUtils . clutter_actor_reparent (actor, notification_group);
2054- notification_stack. show_notification (actor);
2055- });
2056- }
2057- });
2058-
20592063 var animation_mode = Clutter . AnimationMode . EASE_OUT_CUBIC ;
20602064
20612065 var x2 = - in_group. x;
@@ -2127,11 +2131,8 @@ namespace Gala {
21272131 return ;
21282132 }
21292133
2130- if (switch_workspace_window_created_id > 0 ) {
2131- disconnect (switch_workspace_window_created_id);
2132- switch_workspace_window_created_id = 0 ;
2133- }
21342134 end_switch_workspace ();
2135+
21352136 if (! is_nudge_animation) {
21362137 switch_workspace_completed ();
21372138 }
@@ -2157,7 +2158,7 @@ namespace Gala {
21572158 }
21582159
21592160 private void end_switch_workspace () {
2160- if (windows == null || parents == null )
2161+ if (( windows == null || parents == null ) && tmp_actors == null )
21612162 return ;
21622163
21632164 unowned var display = get_display ();
0 commit comments