@@ -80,6 +80,7 @@ public class Gala.WindowClone : Clutter.Actor {
8080 }
8181 }
8282
83+ private WindowActorFetcher ? window_actor_fetcher = null ;
8384 private DragDropAction ? drag_action = null ;
8485 private Clutter . Clone ? clone = null ;
8586 private ShadowEffect ? shadow_effect = null ;
@@ -143,7 +144,12 @@ public class Gala.WindowClone : Clutter.Actor {
143144
144145 reallocate ();
145146
146- load_clone ();
147+ if (window. get_compositor_private () != null ) {
148+ load_clone ();
149+ } else {
150+ window_actor_fetcher = new WindowActorFetcher (window);
151+ window_actor_fetcher. window_actor_ready. connect (load_clone);
152+ }
147153
148154 window. notify[" title" ]. connect (() = > window_title. set_text (window. get_title () ?? " " ));
149155 window_title. set_text (window. get_title () ?? " " );
@@ -176,24 +182,14 @@ public class Gala.WindowClone : Clutter.Actor {
176182 }
177183
178184 /**
179- * Waits for the texture of a new Meta.WindowActor to be available
180- * and makes a close of it. If it was already was assigned a slot
185+ * Makes a clone of the window. If the window was already was assigned a slot
181186 * at this point it will animate to it. Otherwise it will just place
182187 * itself at the location of the original window. Also adds the shadow
183188 * effect and makes sure the shadow is updated on size changes.
184189 */
185- private void load_clone () {
186- var actor = (Meta . WindowActor ) window. get_compositor_private ();
187- if (actor == null ) {
188- Idle . add (() = > {
189- if (window. get_compositor_private () != null ) {
190- load_clone ();
191- }
192- return Source . REMOVE ;
193- });
194-
195- return ;
196- }
190+ private void load_clone () requires (window .get_compositor_private () != null) {
191+ window_actor_fetcher = null ;
192+ unowned var actor = (Meta . WindowActor ) window. get_compositor_private ();
197193
198194 if (overview_mode) {
199195 actor. hide ();
0 commit comments