Skip to content

Commit

Permalink
Fix flicker for non autohide panels
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 committed Dec 10, 2024
1 parent a97122c commit 776a007
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 34 deletions.
10 changes: 2 additions & 8 deletions src/ShellClients/PanelClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
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;
panel_hidden = false;
});
clone.visible = false;
panel_hidden = false;
}
});
}
Expand Down
44 changes: 18 additions & 26 deletions src/Widgets/MultitaskingView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -702,37 +702,29 @@ namespace Gala {
ShellClientsManager.get_instance ().set_force_hide_panels (false, multitasking_gesture_tracker, with_gesture);
}

GestureTracker.OnEnd on_animation_end = (percentage, cancel_action, calculated_duration) => {
Timeout.add (calculated_duration, () => {
if (!opening) {
foreach (var container in window_containers_monitors) {
container.visible = false;
}

hide ();

wm.background_group.show ();
wm.window_group.show ();
wm.top_window_group.show ();

wm.pop_modal (modal_proxy);
// The callback needs to run at the same frame as the others (e.g. PanelClone) so we can't do a simple Timeout here
// 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) {
foreach (var container in window_containers_monitors) {
container.visible = false;
}

animating = false;
hide ();

if (cancel_action) {
toggle (false, true);
}
wm.background_group.show ();
wm.window_group.show ();
wm.top_window_group.show ();

return Source.REMOVE;
});
};
wm.pop_modal (modal_proxy);
}

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);
}
animating = false;

if (cancel_action) {
toggle (false, true);
}
});
}

private bool keybinding_filter (Meta.KeyBinding binding) {
Expand Down

0 comments on commit 776a007

Please sign in to comment.