PanelClone: Don't animate while in fullscreen (#1927)

Co-authored-by: Danielle Foré <danielle@elementary.io>
This commit is contained in:
Leonhard 2024-05-28 21:46:06 +02:00 committed by GitHub
parent b8d705875f
commit dde55d8736
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -104,6 +104,12 @@ public class Gala.PanelClone : Object {
}
}
private int get_animation_duration () {
var fullscreen = wm.get_display ().get_monitor_in_fullscreen (panel.window.get_monitor ());
var should_animate = wm.enable_animations && !wm.workspace_view.is_opened () && !fullscreen;
return should_animate ? ANIMATION_DURATION : 0;
}
private void hide () {
if (panel_hidden) {
return;
@ -120,7 +126,7 @@ public class Gala.PanelClone : Object {
clone.save_easing_state ();
clone.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
clone.set_easing_duration (wm.enable_animations && !wm.workspace_view.is_opened () ? ANIMATION_DURATION : 0);
clone.set_easing_duration (get_animation_duration ());
clone.y = calculate_clone_y (true);
clone.restore_easing_state ();
}
@ -130,7 +136,7 @@ public class Gala.PanelClone : Object {
return;
}
var animation_duration = wm.enable_animations && !wm.workspace_view.is_opened () ? ANIMATION_DURATION : 0;
var animation_duration = get_animation_duration ();
clone.save_easing_state ();
clone.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);