Fix flicker for non autohide panels

This commit is contained in:
Leonhard Kargl 2024-12-10 14:45:48 +01:00
parent a97122c830
commit 776a0074d5
2 changed files with 20 additions and 34 deletions

View File

@ -156,14 +156,8 @@ public class Gala.PanelClone : Object {
new GesturePropertyTransition (clone, gesture_tracker, "y", null, calculate_clone_y (false)).start (with_gesture, (cancel_action) => { new GesturePropertyTransition (clone, gesture_tracker, "y", null, calculate_clone_y (false)).start (with_gesture, (cancel_action) => {
if (!cancel_action) { if (!cancel_action) {
// We need the small timeout because in the case that we're showing in sync with the multitasking view
// we have to make sure that we hide the clone after the multitasking view was already hidden otherwise
// it flickers because the actual window actors are hidden by the multitasking view
Timeout.add_once (10, () => {
force_hide = false;
clone.visible = false; clone.visible = false;
panel_hidden = false; panel_hidden = false;
});
} }
}); });
} }

View File

@ -702,8 +702,9 @@ namespace Gala {
ShellClientsManager.get_instance ().set_force_hide_panels (false, multitasking_gesture_tracker, with_gesture); ShellClientsManager.get_instance ().set_force_hide_panels (false, multitasking_gesture_tracker, with_gesture);
} }
GestureTracker.OnEnd on_animation_end = (percentage, cancel_action, calculated_duration) => { // The callback needs to run at the same frame as the others (e.g. PanelClone) so we can't do a simple Timeout here
Timeout.add (calculated_duration, () => { // The actual transition does nothing here, since the opacity just stays at 255
new GesturePropertyTransition (this, multitasking_gesture_tracker, "opacity", null, 255u).start (with_gesture, (cancel_action) => {
if (!opening) { if (!opening) {
foreach (var container in window_containers_monitors) { foreach (var container in window_containers_monitors) {
container.visible = false; container.visible = false;
@ -723,16 +724,7 @@ namespace Gala {
if (cancel_action) { if (cancel_action) {
toggle (false, true); toggle (false, true);
} }
return Source.REMOVE;
}); });
};
if (!with_gesture) {
on_animation_end (1, false, is_cancel_animation ? 0 : ANIMATION_DURATION);
} else {
multitasking_gesture_tracker.connect_handlers (null, null, (owned) on_animation_end);
}
} }
private bool keybinding_filter (Meta.KeyBinding binding) { private bool keybinding_filter (Meta.KeyBinding binding) {