mirror of
https://github.com/elementary/gala.git
synced 2024-12-19 07:11:56 +03:00
Avoid connecting multiple times to window_created
(#1599)
This commit is contained in:
parent
cf2b835641
commit
1a4c1e8f95
@ -111,8 +111,6 @@ namespace Gala {
|
|||||||
private GLib.Settings animations_settings;
|
private GLib.Settings animations_settings;
|
||||||
private GLib.Settings behavior_settings;
|
private GLib.Settings behavior_settings;
|
||||||
|
|
||||||
private ulong workspace_switching_window_created_id = 0;
|
|
||||||
|
|
||||||
private GestureTracker gesture_tracker;
|
private GestureTracker gesture_tracker;
|
||||||
private bool animating_switch_workspace = false;
|
private bool animating_switch_workspace = false;
|
||||||
private bool switch_workspace_with_gesture = false;
|
private bool switch_workspace_with_gesture = false;
|
||||||
@ -358,6 +356,20 @@ namespace Gala {
|
|||||||
|
|
||||||
update_input_area ();
|
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 ();
|
stage.show ();
|
||||||
|
|
||||||
Idle.add (() => {
|
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.clip_to_allocation = true;
|
||||||
main_container.x = move_primary_only ? monitor_geom.x : 0.0f;
|
main_container.x = move_primary_only ? monitor_geom.x : 0.0f;
|
||||||
main_container.y = move_primary_only ? monitor_geom.y : 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) {
|
if (tmp_actors != null) {
|
||||||
foreach (var actor in tmp_actors) {
|
foreach (var actor in tmp_actors) {
|
||||||
actor.destroy ();
|
actor.destroy ();
|
||||||
|
Loading…
Reference in New Issue
Block a user