File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -340,16 +340,22 @@ namespace Gala {
340340
341341 public static void wait_for_window_actor (Meta . Window window, owned WindowActorReadyCallback callback) {
342342 unowned var window_actor = (Meta . WindowActor ) window. get_compositor_private ();
343- if (window_actor != null ) {
343+ if (window_actor != null && window_actor . visible ) {
344344 callback (window_actor);
345345 return ;
346346 }
347347
348348 Idle . add (() = > {
349349 window_actor = (Meta . WindowActor ) window. get_compositor_private ();
350350
351- if (window_actor != null ) {
351+ if (window_actor != null && window_actor . visible ) {
352352 callback (window_actor);
353+ } else if (window_actor != null ) {
354+ ulong show_handler = 0 ;
355+ show_handler = window_actor. show. connect (() = > {
356+ window_actor. disconnect (show_handler);
357+ callback (window_actor);
358+ });
353359 }
354360
355361 return Source . REMOVE ;
Original file line number Diff line number Diff line change @@ -2120,9 +2120,10 @@ namespace Gala {
21202120 // TODO: currently only notifications are handled here, other windows should be too
21212121 switch_workspace_window_created_id = window_created. connect ((window) = > {
21222122 if (NotificationStack . is_notification (window)) {
2123- unowned var actor = (Meta . WindowActor ) window. get_compositor_private ();
2124- clutter_actor_reparent (actor, notification_group);
2125- notification_stack. show_notification (actor);
2123+ InternalUtils . wait_for_window_actor (window, (actor) = > {
2124+ clutter_actor_reparent (actor, notification_group);
2125+ notification_stack. show_notification (actor);
2126+ });
21262127 }
21272128 });
21282129
You can’t perform that action at this time.
0 commit comments