Skip to content

Commit 5d19b17

Browse files
committed
do-not-animate-on-three-touch-lateral-swipe
1 parent a8aed7e commit 5d19b17

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

[email protected]/workspacePopup/workspaceAnimation.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,29 @@ const MonitorGroup = GObject.registerClass({
218218
});
219219

220220
export class WorkspaceAnimationController extends GWorkspaceAnimationController {
221+
animateSwitch(from, to, direction, onComplete) {
222+
if (this._isSwipeEvent()) {
223+
switch (direction) {
224+
case Meta.MotionDirection.RIGHT:
225+
case Meta.MotionDirection.LEFT:
226+
return onComplete();
227+
case Meta.MotionDirection.DOWN:
228+
case Meta.MotionDirection.UP:
229+
console.log("animateSwitch touch up or down", direction);
230+
super.animateSwitch(from, to, direction, onComplete);
231+
return onComplete();
232+
}
233+
} else {
234+
switch (direction) {
235+
case Meta.MotionDirection.RIGHT:
236+
case Meta.MotionDirection.LEFT:
237+
case Meta.MotionDirection.DOWN:
238+
case Meta.MotionDirection.UP:
239+
super.animateSwitch(from, to, direction, onComplete);
240+
break;
241+
}
242+
}
243+
}
221244
_prepareWorkspaceSwitch(workspaceIndices) {
222245
if (this._switchData)
223246
return;
@@ -253,4 +276,7 @@ export class WorkspaceAnimationController extends GWorkspaceAnimationController
253276

254277
Meta.disable_unredirect_for_display(global.display);
255278
}
279+
_isSwipeEvent() {
280+
return Clutter.get_current_event() === null;
281+
}
256282
}

0 commit comments

Comments
 (0)