Skip to content

Commit

Permalink
Fix awkward two-finger scroll in multitasking view (#1499)
Browse files Browse the repository at this point in the history
  • Loading branch information
GranPC committed Dec 21, 2022
1 parent 34a208e commit c175d26
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Widgets/MultitaskingView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,21 @@ namespace Gala {
(uint) (AnimationDuration.NUDGE / 2) :
(uint) calculated_duration;

workspaces.save_easing_state ();
workspaces.set_easing_duration (duration);
workspaces.x = (is_nudge_animation || cancel_action) ? initial_x : target_x;
workspaces.restore_easing_state ();

workspaces.get_transition ("x").completed.connect (() => {
workspace_gesture_tracker.enabled = true;

if (!is_nudge_animation && !cancel_action) {
manager.get_workspace_by_index (target_workspace_index).activate (display.get_current_time ());
update_positions (false);
} else {
// Reset easing parameters either way.
// This stops the animation from causing touch events to "lag" behind.
workspaces.set_easing_duration (0);
}
});
};
Expand Down

0 comments on commit c175d26

Please sign in to comment.