diff --git a/lib/Gestures/ActorTarget.vala b/lib/Gestures/ActorTarget.vala index 6884fa581..d847221b2 100644 --- a/lib/Gestures/ActorTarget.vala +++ b/lib/Gestures/ActorTarget.vala @@ -84,6 +84,7 @@ public class Gala.ActorTarget : Clutter.Actor, GestureTarget { switch (update_type) { case START: ongoing_animations++; + notify_property ("animating"); start_progress (action); break; case UPDATE: @@ -94,6 +95,7 @@ public class Gala.ActorTarget : Clutter.Actor, GestureTarget { break; case END: ongoing_animations--; + notify_property ("animating"); end_progress (action); break; } diff --git a/src/Widgets/MultitaskingView/WindowClone.vala b/src/Widgets/MultitaskingView/WindowClone.vala index 79b3d1a72..d1607a30e 100644 --- a/src/Widgets/MultitaskingView/WindowClone.vala +++ b/src/Widgets/MultitaskingView/WindowClone.vala @@ -72,7 +72,6 @@ public class Gala.WindowClone : ActorTarget, RootTarget { private Clutter.Clone? drag_handle = null; private ulong check_confirm_dialog_cb = 0; - private bool in_slot_animation = false; private Clutter.Actor clone_container; private Gala.CloseButton close_button; @@ -142,7 +141,7 @@ public class Gala.WindowClone : ActorTarget, RootTarget { }; bind_property ("monitor-scale", close_button, "monitor-scale"); close_button.triggered.connect (close_window); - close_button.notify["has-pointer"].connect (() => update_hover_widgets ()); + close_button.notify["has-pointer"].connect (update_hover_widgets); add_child (active_shape); add_child (clone_container); @@ -157,7 +156,8 @@ public class Gala.WindowClone : ActorTarget, RootTarget { window.notify["title"].connect (() => window_title.set_text (window.get_title () ?? "")); window_title.set_text (window.get_title () ?? ""); - notify["has-pointer"].connect (() => update_hover_widgets ()); + notify["has-pointer"].connect (update_hover_widgets); + notify["animating"].connect (update_hover_widgets); } ~WindowClone () { @@ -272,12 +272,8 @@ public class Gala.WindowClone : ActorTarget, RootTarget { add_target (new PropertyTarget (MULTITASKING_VIEW, window_title, "opacity", typeof (uint), 0u, 255u)); } - public override void start_progress (GestureAction action) { - update_hover_widgets (true); - } - public override void update_progress (Gala.GestureAction action, double progress) { - if (action != CUSTOM || slot == null || !Meta.Prefs.get_gnome_animations ()) { + if (action != CUSTOM || !has_pointer || slot == null || !Meta.Prefs.get_gnome_animations ()) { return; } @@ -298,8 +294,6 @@ public class Gala.WindowClone : ActorTarget, RootTarget { } public override void end_progress (GestureAction action) { - update_hover_widgets (false); - if (action == CUSTOM && get_current_commit (CUSTOM) > 0.5 && Meta.Prefs.get_gnome_animations ()) { close_window (Meta.CURRENT_TIME); } @@ -376,14 +370,10 @@ public class Gala.WindowClone : ActorTarget, RootTarget { return Clutter.EVENT_STOP; } - private void update_hover_widgets (bool? animating = null) { - if (animating != null) { - in_slot_animation = animating; - } - + private void update_hover_widgets () { var duration = Utils.get_animation_duration (FADE_ANIMATION_DURATION); - var show = (has_pointer || close_button.has_pointer) && !in_slot_animation; + var show = (has_pointer || close_button.has_pointer) && !animating; close_button.save_easing_state (); close_button.set_easing_mode (Clutter.AnimationMode.LINEAR);