Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions [email protected]/workspacePopup/workspaceAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,22 @@ const MonitorGroup = GObject.registerClass({
});

export class WorkspaceAnimationController extends GWorkspaceAnimationController {
animateSwitch(from, to, direction, onComplete) {
if (this._isSwipeEvent()) {
switch (direction) {
case Meta.MotionDirection.RIGHT:
case Meta.MotionDirection.LEFT:
return onComplete();
case Meta.MotionDirection.DOWN:
case Meta.MotionDirection.UP:
console.log("animateSwitch touch up or down", direction);
super.animateSwitch(from, to, direction, onComplete);
return onComplete();
}
} else {
super.animateSwitch(from, to, direction, onComplete);
}
}
_prepareWorkspaceSwitch(workspaceIndices) {
if (this._switchData)
return;
Expand Down Expand Up @@ -253,4 +269,7 @@ export class WorkspaceAnimationController extends GWorkspaceAnimationController

Meta.disable_unredirect_for_display(global.display);
}
_isSwipeEvent() {
return Clutter.get_current_event() === null;
}
}