diff --git a/src/WindowManager.vala b/src/WindowManager.vala index ba1b0e14..80a03fcc 100644 --- a/src/WindowManager.vala +++ b/src/WindowManager.vala @@ -111,8 +111,6 @@ namespace Gala { private GLib.Settings animations_settings; private GLib.Settings behavior_settings; - private ulong workspace_switching_window_created_id = 0; - private GestureTracker gesture_tracker; private bool animating_switch_workspace = false; private bool switch_workspace_with_gesture = false; @@ -358,6 +356,20 @@ namespace Gala { update_input_area (); + // while a workspace is being switched mutter doesn't map windows + // TODO: currently only notifications are handled here, other windows should be too + display.window_created.connect ((window) => { + if (!animating_switch_workspace) { + return; + } + + if (window.window_type == Meta.WindowType.NOTIFICATION) { + unowned var actor = (Meta.WindowActor) window.get_compositor_private (); + clutter_actor_reparent (actor, notification_group); + notification_stack.show_notification (actor, enable_animations); + } + }); + stage.show (); Idle.add (() => { @@ -1894,15 +1906,6 @@ namespace Gala { } } - workspace_switching_window_created_id = display.window_created.connect ((window) => { - if (window.window_type == Meta.WindowType.NOTIFICATION) { - unowned var actor = (Meta.WindowActor) window.get_compositor_private (); - // while a workspace is being switched mutter doesn't map windows - // TODO: currently only notifications are handled here, other windows should be too - clutter_actor_reparent (actor, notification_group); - notification_stack.show_notification (actor, enable_animations); - } - }); main_container.clip_to_allocation = true; main_container.x = move_primary_only ? monitor_geom.x : 0.0f; main_container.y = move_primary_only ? monitor_geom.y : 0.0f; @@ -2063,8 +2066,6 @@ namespace Gala { } } - display.disconnect (workspace_switching_window_created_id); - if (tmp_actors != null) { foreach (var actor in tmp_actors) { actor.destroy ();