Map notification windows manually while switching workspace (#1577)

This commit is contained in:
Leo 2023-03-21 00:13:31 +09:00 committed by GitHub
parent b7139add23
commit 97b33173e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,8 @@ 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;
@ -1886,6 +1888,20 @@ 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
notification_stack.show_notification (actor, enable_animations);
windows.prepend (actor);
parents.prepend (actor.get_parent ());
reparent_notification_window (actor, static_windows);
}
});
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;
@ -2051,6 +2067,8 @@ namespace Gala {
}
}
display.disconnect (workspace_switching_window_created_id);
if (tmp_actors != null) {
foreach (var actor in tmp_actors) {
actor.destroy ();