Skip to content

Commit

Permalink
Fix cancelling workspace switch gesture (#2148)
Browse files Browse the repository at this point in the history
Co-authored-by: Leo <[email protected]>
  • Loading branch information
leolost2605 and lenemter authored Dec 12, 2024
1 parent 74f91ae commit 32a5f35
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -2201,7 +2201,6 @@ namespace Gala {
if (!animating_switch_workspace) {
return;
}
animating_switch_workspace = cancel_action;

if (switch_workspace_window_created_id > 0) {
disconnect (switch_workspace_window_created_id);
Expand All @@ -2212,6 +2211,8 @@ namespace Gala {
switch_workspace_completed ();
}

animating_switch_workspace = cancel_action;

if (cancel_action) {
var cancel_direction = (animation_direction == Meta.MotionDirection.LEFT)
? Meta.MotionDirection.RIGHT
Expand Down Expand Up @@ -2293,8 +2294,7 @@ namespace Gala {
}

public override void kill_switch_workspace () {
// 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 ()
switch_workspace_animation_finished (LEFT, false, true);
end_switch_workspace ();
}

public override void locate_pointer () {
Expand Down

0 comments on commit 32a5f35

Please sign in to comment.