@@ -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,16 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
105109 }
106110 }
107111
112+ private void on_failsafe_timeout () {
113+ if (starting_panels > 0 ) {
114+ // At least one panel didn't start in time (crash loop, not installed, etc.) so just show the others
115+ starting_panels = 0 ;
116+ foreach (var window in panel_windows. get_values ()) {
117+ window. show ();
118+ }
119+ }
120+ }
121+
108122 public void make_dock (Meta .Window window ) {
109123#if HAS_MUTTER49
110124 window. set_type (Meta . WindowType . DOCK );
@@ -160,10 +174,28 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
160174
161175 panel_windows[window] = new PanelWindow (wm, window, anchor);
162176
177+ InternalUtils . wait_for_window_actor_visible (window, on_panel_ready);
178+
163179 // connect_after so we make sure the PanelWindow can destroy its barriers and struts
164180 window. unmanaging. connect_after ((_window) = > panel_windows. remove (_window));
165181 }
166182
183+ private void on_panel_ready (Meta .WindowActor actor ) {
184+ if (starting_panels == 0 ) {
185+ panel_windows[actor. meta_window]. show ();
186+ return ;
187+ }
188+
189+ starting_panels-- ;
190+ assert (starting_panels >= 0 );
191+
192+ if (starting_panels == 0 ) {
193+ foreach (var window in panel_windows. get_values ()) {
194+ window. show ();
195+ }
196+ }
197+ }
198+
167199 /**
168200 * The size given here is only used for the hide mode. I.e. struts
169201 * and collision detection with other windows use this size. By default
0 commit comments