From 779ff1886eae5daa7247a09215b299aaa9a25159 Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:32:33 +0100 Subject: [PATCH] Fix cancelling gesture in multitasking view (#2149) Co-authored-by: Leo --- src/Widgets/MonitorClone.vala | 2 +- src/Widgets/WindowClone.vala | 6 +++--- src/Widgets/WindowCloneContainer.vala | 6 +++--- src/Widgets/WorkspaceClone.vala | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Widgets/MonitorClone.vala b/src/Widgets/MonitorClone.vala index c54812773..5f6f66e7f 100644 --- a/src/Widgets/MonitorClone.vala +++ b/src/Widgets/MonitorClone.vala @@ -102,7 +102,7 @@ namespace Gala { */ public void close (bool with_gesture = false, bool is_cancel_animation = false) { window_container.restack_windows (); - window_container.close (with_gesture, is_cancel_animation); + window_container.close (with_gesture); } private void window_left (int window_monitor, Meta.Window window) { diff --git a/src/Widgets/WindowClone.vala b/src/Widgets/WindowClone.vala index db747dc10..05c678810 100644 --- a/src/Widgets/WindowClone.vala +++ b/src/Widgets/WindowClone.vala @@ -271,7 +271,7 @@ public class Gala.WindowClone : Clutter.Actor { * * @param animate Animate the transformation of the placement */ - public void transition_to_original_state (bool with_gesture = false, bool is_cancel_animation = false) { + public void transition_to_original_state (bool with_gesture = false) { var outer_rect = window.get_frame_rect (); unowned var display = window.get_display (); @@ -332,9 +332,9 @@ public class Gala.WindowClone : Clutter.Actor { * Animate the window to the given slot */ #if HAS_MUTTER45 - public void take_slot (Mtk.Rectangle rect, bool from_window_position, bool with_gesture = false, bool is_cancel_animation = false) { + public void take_slot (Mtk.Rectangle rect, bool from_window_position, bool with_gesture = false) { #else - public void take_slot (Meta.Rectangle rect, bool from_window_position, bool with_gesture = false, bool is_cancel_animation = false) { + public void take_slot (Meta.Rectangle rect, bool from_window_position, bool with_gesture = false) { #endif slot = rect; active = false; diff --git a/src/Widgets/WindowCloneContainer.vala b/src/Widgets/WindowCloneContainer.vala index d6ce80455..0e9bdea6a 100644 --- a/src/Widgets/WindowCloneContainer.vala +++ b/src/Widgets/WindowCloneContainer.vala @@ -206,7 +206,7 @@ namespace Gala { foreach (var tilable in window_positions) { unowned var clone = (WindowClone) tilable.id; - clone.take_slot (tilable.rect, opening, with_gesture, is_cancel_animation); + clone.take_slot (tilable.rect, opening && !is_cancel_animation, with_gesture); } } @@ -400,7 +400,7 @@ namespace Gala { * Calls the transition_to_original_state() function on each child * to make them take their original locations again. */ - public void close (bool with_gesture = false, bool is_cancel_animation = false) { + public void close (bool with_gesture = false) { if (!opened) { return; } @@ -408,7 +408,7 @@ namespace Gala { opened = false; foreach (var window in get_children ()) { - ((WindowClone) window).transition_to_original_state (with_gesture, is_cancel_animation); + ((WindowClone) window).transition_to_original_state (with_gesture); } } } diff --git a/src/Widgets/WorkspaceClone.vala b/src/Widgets/WorkspaceClone.vala index 0c4721ab3..e40562c30 100644 --- a/src/Widgets/WorkspaceClone.vala +++ b/src/Widgets/WorkspaceClone.vala @@ -369,8 +369,8 @@ namespace Gala { update_size (monitor); new GesturePropertyTransition (this, gesture_tracker, "x", initial_x, target_x).start (with_gesture); - new GesturePropertyTransition (background, gesture_tracker, "scale-x", 1.0d, (double) scale).start (with_gesture); - new GesturePropertyTransition (background, gesture_tracker, "scale-y", 1.0d, (double) scale).start (with_gesture); + new GesturePropertyTransition (background, gesture_tracker, "scale-x", null, (double) scale).start (with_gesture); + new GesturePropertyTransition (background, gesture_tracker, "scale-y", null, (double) scale).start (with_gesture); #if HAS_MUTTER45 Mtk.Rectangle area = { @@ -415,7 +415,7 @@ namespace Gala { new GesturePropertyTransition (background, gesture_tracker, "scale-x", null, 1.0d).start (with_gesture); new GesturePropertyTransition (background, gesture_tracker, "scale-y", null, 1.0d).start (with_gesture); - window_container.close (with_gesture, is_cancel_animation); + window_container.close (with_gesture); } } }