Skip to content

Commit

Permalink
Fix cancelling gesture in multitasking view (#2149)
Browse files Browse the repository at this point in the history
Co-authored-by: Leo <lenemter@gmail.com>
  • Loading branch information
leolost2605 and lenemter authored Dec 12, 2024
1 parent 32a5f35 commit 779ff18
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Widgets/MonitorClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions src/Widgets/WindowClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/Widgets/WindowCloneContainer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -400,15 +400,15 @@ 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;
}

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);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Widgets/WorkspaceClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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);
}
}
}

0 comments on commit 779ff18

Please sign in to comment.