From dde55d873670798d5f481562f5ee7756dd4fdc92 Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Tue, 28 May 2024 21:46:06 +0200 Subject: [PATCH] PanelClone: Don't animate while in fullscreen (#1927) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Danielle Foré --- src/ShellClients/PanelClone.vala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ShellClients/PanelClone.vala b/src/ShellClients/PanelClone.vala index 13baeae1..c241269b 100644 --- a/src/ShellClients/PanelClone.vala +++ b/src/ShellClients/PanelClone.vala @@ -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);