@@ -25,6 +25,8 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
2525 private NotificationsClient notifications_client;
2626 private ManagedClient [] protocol_clients = {};
2727
28+ private int starting_panels = 0 ;
29+
2830 private GLib . HashTable<Meta . Window , PanelWindow > panel_windows = new GLib .HashTable<Meta . Window , PanelWindow > (null , null );
2931 private GLib . HashTable<Meta . Window , ShellWindow > positioned_windows = new GLib .HashTable<Meta . Window , ShellWindow > (null , null );
3032
@@ -43,6 +45,8 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
4345 parse_mutter_hints (window);
4446 });
4547 }
48+
49+ Timeout . add_seconds_once (5 , on_failsafe_timeout);
4650 }
4751
4852 private async void start_clients () {
@@ -103,6 +107,19 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
103107 warning (" Failed to load launch args for client %s : %s " , group, e. message);
104108 }
105109 }
110+
111+ starting_panels = protocol_clients. length;
112+ }
113+
114+ private void on_failsafe_timeout () {
115+ if (starting_panels > 0 ) {
116+ warning (" %d panels failed to start in time, showing the others" , starting_panels);
117+
118+ starting_panels = 0 ;
119+ foreach (var window in panel_windows. get_values ()) {
120+ window. animate_start ();
121+ }
122+ }
106123 }
107124
108125 public void make_dock (Meta .Window window ) {
@@ -160,10 +177,28 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
160177
161178 panel_windows[window] = new PanelWindow (wm, window, anchor);
162179
180+ InternalUtils . wait_for_window_actor_visible (window, on_panel_ready);
181+
163182 // connect_after so we make sure the PanelWindow can destroy its barriers and struts
164183 window. unmanaging. connect_after ((_window) = > panel_windows. remove (_window));
165184 }
166185
186+ private void on_panel_ready (Meta .WindowActor actor ) {
187+ if (starting_panels == 0 ) {
188+ panel_windows[actor. meta_window]. animate_start ();
189+ return ;
190+ }
191+
192+ starting_panels-- ;
193+ assert (starting_panels >= 0 );
194+
195+ if (starting_panels == 0 ) {
196+ foreach (var window in panel_windows. get_values ()) {
197+ window. animate_start ();
198+ }
199+ }
200+ }
201+
167202 /**
168203 * The size given here is only used for the hide mode. I.e. struts
169204 * and collision detection with other windows use this size. By default
0 commit comments