Skip to content

Commit 13bf5e3

Browse files
authored
Merge branch 'main' into leolost/fix-window-shown-multitasking-view
2 parents 307cece + 779ff18 commit 13bf5e3

File tree

6 files changed

+24
-22
lines changed

6 files changed

+24
-22
lines changed

src/ShellClients/HideTracker.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public class Gala.HideTracker : Object {
171171
continue;
172172
}
173173

174-
if (!panel.window.get_frame_rect ().overlap (window.get_frame_rect ())) {
174+
if (!panel.get_custom_window_rect ().overlap (window.get_frame_rect ())) {
175175
continue;
176176
}
177177

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
@@ -258,7 +258,7 @@ public class Gala.WindowClone : Clutter.Actor {
258258
*
259259
* @param animate Animate the transformation of the placement
260260
*/
261-
public void transition_to_original_state (bool with_gesture = false, bool is_cancel_animation = false) {
261+
public void transition_to_original_state (bool with_gesture = false) {
262262
var outer_rect = window.get_frame_rect ();
263263

264264
unowned var display = window.get_display ();
@@ -319,9 +319,9 @@ public class Gala.WindowClone : Clutter.Actor {
319319
* Animate the window to the given slot
320320
*/
321321
#if HAS_MUTTER45
322-
public void take_slot (Mtk.Rectangle rect, bool from_window_position, bool with_gesture = false, bool is_cancel_animation = false) {
322+
public void take_slot (Mtk.Rectangle rect, bool from_window_position, bool with_gesture = false) {
323323
#else
324-
public void take_slot (Meta.Rectangle rect, bool from_window_position, bool with_gesture = false, bool is_cancel_animation = false) {
324+
public void take_slot (Meta.Rectangle rect, bool from_window_position, bool with_gesture = false) {
325325
#endif
326326
slot = rect;
327327
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
}

src/WindowManager.vala

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace Gala {
9797
#else
9898
private Meta.Rectangle old_rect_size_change;
9999
#endif
100-
private Clutter.Actor latest_window_snapshot;
100+
private Clutter.Actor? latest_window_snapshot;
101101

102102
private GLib.Settings behavior_settings;
103103
private GLib.Settings new_behavior_settings;
@@ -1402,13 +1402,13 @@ namespace Gala {
14021402
latest_window_snapshot.restore_easing_state ();
14031403

14041404
ulong maximize_old_handler_id = 0UL;
1405-
maximize_old_handler_id = latest_window_snapshot.transitions_completed.connect (() => {
1406-
latest_window_snapshot.disconnect (maximize_old_handler_id);
1407-
latest_window_snapshot.destroy ();
1405+
maximize_old_handler_id = latest_window_snapshot.transitions_completed.connect ((snapshot) => {
1406+
snapshot.disconnect (maximize_old_handler_id);
1407+
snapshot.destroy ();
14081408
actor.set_translation (0.0f, 0.0f, 0.0f);
14091409
});
14101410

1411-
latest_window_snapshot.restore_easing_state ();
1411+
latest_window_snapshot = null;
14121412

14131413
actor.set_pivot_point (0.0f, 0.0f);
14141414
actor.set_translation (old_rect_size_change.x - ex, old_rect_size_change.y - ey, 0.0f);
@@ -1775,11 +1775,13 @@ namespace Gala {
17751775
latest_window_snapshot.restore_easing_state ();
17761776

17771777
ulong unmaximize_old_handler_id = 0UL;
1778-
unmaximize_old_handler_id = latest_window_snapshot.transitions_completed.connect (() => {
1779-
latest_window_snapshot.disconnect (unmaximize_old_handler_id);
1780-
latest_window_snapshot.destroy ();
1778+
unmaximize_old_handler_id = latest_window_snapshot.transitions_completed.connect ((snapshot) => {
1779+
snapshot.disconnect (unmaximize_old_handler_id);
1780+
snapshot.destroy ();
17811781
});
17821782

1783+
latest_window_snapshot = null;
1784+
17831785
actor.set_pivot_point (0.0f, 0.0f);
17841786
actor.set_position (ex, ey);
17851787
actor.set_translation (-ex + offset_x * (1.0f / scale_x - 1.0f) + old_rect_size_change.x, -ey + offset_y * (1.0f / scale_y - 1.0f) + old_rect_size_change.y, 0.0f);
@@ -2199,7 +2201,6 @@ namespace Gala {
21992201
if (!animating_switch_workspace) {
22002202
return;
22012203
}
2202-
animating_switch_workspace = cancel_action;
22032204

22042205
if (switch_workspace_window_created_id > 0) {
22052206
disconnect (switch_workspace_window_created_id);
@@ -2210,6 +2211,8 @@ namespace Gala {
22102211
switch_workspace_completed ();
22112212
}
22122213

2214+
animating_switch_workspace = cancel_action;
2215+
22132216
if (cancel_action) {
22142217
var cancel_direction = (animation_direction == Meta.MotionDirection.LEFT)
22152218
? Meta.MotionDirection.RIGHT
@@ -2291,8 +2294,7 @@ namespace Gala {
22912294
}
22922295

22932296
public override void kill_switch_workspace () {
2294-
// We don't care about animation direction, we don't want to cancel it, make it nudge so that it doesn't call switch_workspace_completed ()
2295-
switch_workspace_animation_finished (LEFT, false, true);
2297+
end_switch_workspace ();
22962298
}
22972299

22982300
public override void locate_pointer () {

0 commit comments

Comments
 (0)