Skip to content

Commit 779ff18

Browse files
Fix cancelling gesture in multitasking view (#2149)
Co-authored-by: Leo <[email protected]>
1 parent 32a5f35 commit 779ff18

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/Widgets/MonitorClone.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ namespace Gala {
102102
*/
103103
public void close (bool with_gesture = false, bool is_cancel_animation = false) {
104104
window_container.restack_windows ();
105-
window_container.close (with_gesture, is_cancel_animation);
105+
window_container.close (with_gesture);
106106
}
107107

108108
private void window_left (int window_monitor, Meta.Window window) {

src/Widgets/WindowClone.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public class Gala.WindowClone : Clutter.Actor {
271271
*
272272
* @param animate Animate the transformation of the placement
273273
*/
274-
public void transition_to_original_state (bool with_gesture = false, bool is_cancel_animation = false) {
274+
public void transition_to_original_state (bool with_gesture = false) {
275275
var outer_rect = window.get_frame_rect ();
276276

277277
unowned var display = window.get_display ();
@@ -332,9 +332,9 @@ public class Gala.WindowClone : Clutter.Actor {
332332
* Animate the window to the given slot
333333
*/
334334
#if HAS_MUTTER45
335-
public void take_slot (Mtk.Rectangle rect, bool from_window_position, bool with_gesture = false, bool is_cancel_animation = false) {
335+
public void take_slot (Mtk.Rectangle rect, bool from_window_position, bool with_gesture = false) {
336336
#else
337-
public void take_slot (Meta.Rectangle rect, bool from_window_position, bool with_gesture = false, bool is_cancel_animation = false) {
337+
public void take_slot (Meta.Rectangle rect, bool from_window_position, bool with_gesture = false) {
338338
#endif
339339
slot = rect;
340340
active = false;

src/Widgets/WindowCloneContainer.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ namespace Gala {
206206

207207
foreach (var tilable in window_positions) {
208208
unowned var clone = (WindowClone) tilable.id;
209-
clone.take_slot (tilable.rect, opening, with_gesture, is_cancel_animation);
209+
clone.take_slot (tilable.rect, opening && !is_cancel_animation, with_gesture);
210210
}
211211
}
212212

@@ -400,15 +400,15 @@ namespace Gala {
400400
* Calls the transition_to_original_state() function on each child
401401
* to make them take their original locations again.
402402
*/
403-
public void close (bool with_gesture = false, bool is_cancel_animation = false) {
403+
public void close (bool with_gesture = false) {
404404
if (!opened) {
405405
return;
406406
}
407407

408408
opened = false;
409409

410410
foreach (var window in get_children ()) {
411-
((WindowClone) window).transition_to_original_state (with_gesture, is_cancel_animation);
411+
((WindowClone) window).transition_to_original_state (with_gesture);
412412
}
413413
}
414414
}

src/Widgets/WorkspaceClone.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ namespace Gala {
369369
update_size (monitor);
370370

371371
new GesturePropertyTransition (this, gesture_tracker, "x", initial_x, target_x).start (with_gesture);
372-
new GesturePropertyTransition (background, gesture_tracker, "scale-x", 1.0d, (double) scale).start (with_gesture);
373-
new GesturePropertyTransition (background, gesture_tracker, "scale-y", 1.0d, (double) scale).start (with_gesture);
372+
new GesturePropertyTransition (background, gesture_tracker, "scale-x", null, (double) scale).start (with_gesture);
373+
new GesturePropertyTransition (background, gesture_tracker, "scale-y", null, (double) scale).start (with_gesture);
374374

375375
#if HAS_MUTTER45
376376
Mtk.Rectangle area = {
@@ -415,7 +415,7 @@ namespace Gala {
415415
new GesturePropertyTransition (background, gesture_tracker, "scale-x", null, 1.0d).start (with_gesture);
416416
new GesturePropertyTransition (background, gesture_tracker, "scale-y", null, 1.0d).start (with_gesture);
417417

418-
window_container.close (with_gesture, is_cancel_animation);
418+
window_container.close (with_gesture);
419419
}
420420
}
421421
}

0 commit comments

Comments
 (0)