swipeTracker: Reset before emitting 'end' and not after

If the actor is unmapped in the handler, the touch gesture will cancel.
Since we haven't reset the state yet, it will still work and will actually
cancel the gesture, so reset before that instead.

Fixes overview cancelling when trying to open it with a swipe.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1731>
This commit is contained in:
Alexander Mikhaylenko 2021-03-13 19:57:53 +05:00 committed by Marge Bot
parent 3c1074085e
commit f48e58a81a

View File

@ -741,8 +741,8 @@ var SwipeTracker = GObject.registerClass({
if (duration > 0)
duration = Math.clamp(duration, MIN_ANIMATION_DURATION, maxDuration);
this.emit('end', duration, endProgress);
this._reset();
this.emit('end', duration, endProgress);
}
_cancelTouchGesture(_gesture, time, distance) {