@@ -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 = 2 ; // wingpanel and dock
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 () {
@@ -105,6 +109,17 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
105109 }
106110 }
107111
112+ private void on_failsafe_timeout () {
113+ if (starting_panels > 0 ) {
114+ warning (" %d panels failed to start in time, showing the others" , starting_panels);
115+
116+ starting_panels = 0 ;
117+ foreach (var window in panel_windows. get_values ()) {
118+ window. show ();
119+ }
120+ }
121+ }
122+
108123 public void make_dock (Meta .Window window ) {
109124#if HAS_MUTTER49
110125 window. set_type (Meta . WindowType . DOCK );
@@ -160,10 +175,28 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
160175
161176 panel_windows[window] = new PanelWindow (wm, window, anchor);
162177
178+ InternalUtils . wait_for_window_actor_visible (window, on_panel_ready);
179+
163180 // connect_after so we make sure the PanelWindow can destroy its barriers and struts
164181 window. unmanaging. connect_after ((_window) = > panel_windows. remove (_window));
165182 }
166183
184+ private void on_panel_ready (Meta .WindowActor actor ) {
185+ if (starting_panels == 0 ) {
186+ panel_windows[actor. meta_window]. show ();
187+ return ;
188+ }
189+
190+ starting_panels-- ;
191+ assert (starting_panels >= 0 );
192+
193+ if (starting_panels == 0 ) {
194+ foreach (var window in panel_windows. get_values ()) {
195+ window. show ();
196+ }
197+ }
198+ }
199+
167200 /**
168201 * The size given here is only used for the hide mode. I.e. struts
169202 * and collision detection with other windows use this size. By default
0 commit comments