Skip to content

Commit

Permalink
PanelClone: Don't animate while in fullscreen (#1927)
Browse files Browse the repository at this point in the history
Co-authored-by: Danielle Foré <[email protected]>
  • Loading branch information
leolost2605 and danirabbit authored May 28, 2024
1 parent b8d7058 commit dde55d8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ShellClients/PanelClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ();
}
Expand All @@ -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);
Expand Down

0 comments on commit dde55d8

Please sign in to comment.