diff --git a/src/Gestures/GesturePropertyTransition.vala b/src/Gestures/GesturePropertyTransition.vala index 56ab4880..069cdfb3 100644 --- a/src/Gestures/GesturePropertyTransition.vala +++ b/src/Gestures/GesturePropertyTransition.vala @@ -10,7 +10,7 @@ * with easing without a gesture. Respects the enable animation setting. */ public class Gala.GesturePropertyTransition : Object { - public delegate void DoneCallback (bool cancel_action); + public delegate void DoneCallback (int completions); /** * The actor whose property will be animated. @@ -100,13 +100,13 @@ public class Gala.GesturePropertyTransition : Object { if (actual_from_value.type () != current_value.type ()) { warning ("from_value of type %s is not of the same type as the property %s which is %s. Can't animate.", from_value.type_name (), property, current_value.type_name ()); - finish (true); + finish (0); return; } if (current_value.type () != to_value.type ()) { warning ("to_value of type %s is not of the same type as the property %s which is %s. Can't animate.", to_value.type_name (), property, current_value.type_name ()); - finish (true); + finish (0); return; } @@ -152,9 +152,9 @@ public class Gala.GesturePropertyTransition : Object { unowned var transition = actor.get_transition (property); if (transition == null) { - finish (cancel_action); + finish (completions); } else { - transition.stopped.connect ((is_finished) => finish (cancel_action, is_finished)); + transition.stopped.connect ((is_finished) => finish (completions, is_finished)); } }; @@ -181,9 +181,9 @@ public class Gala.GesturePropertyTransition : Object { } } - private void finish (bool cancel_action, bool callback = true) { + private void finish (int completions, bool callback = true) { if (callback && done_callback != null) { - done_callback (cancel_action); + done_callback (completions); } unref (); diff --git a/src/ShellClients/PanelClone.vala b/src/ShellClients/PanelClone.vala index 858441c0..f4e4739c 100644 --- a/src/ShellClients/PanelClone.vala +++ b/src/ShellClients/PanelClone.vala @@ -154,8 +154,8 @@ public class Gala.PanelClone : Object { Utils.x11_unset_window_pass_through (panel.window); } - new GesturePropertyTransition (clone, gesture_tracker, "y", null, calculate_clone_y (false)).start (with_gesture, (cancel_action) => { - if (!cancel_action) { + new GesturePropertyTransition (clone, gesture_tracker, "y", null, calculate_clone_y (false)).start (with_gesture, (completions) => { + if (completions > 0) { clone.visible = false; panel_hidden = false; } diff --git a/src/Widgets/MultitaskingView.vala b/src/Widgets/MultitaskingView.vala index c4bff96b..e0fca230 100644 --- a/src/Widgets/MultitaskingView.vala +++ b/src/Widgets/MultitaskingView.vala @@ -678,7 +678,7 @@ namespace Gala { // 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) => { + new GesturePropertyTransition (this, multitasking_gesture_tracker, "opacity", null, 255u).start (with_gesture, (completions) => { if (!opening) { foreach (var container in window_containers_monitors) { container.visible = false; @@ -695,7 +695,7 @@ namespace Gala { animating = false; - if (cancel_action) { + if (completions == 0) { toggle (false, true); } });