workspaceAnimation: Add gesture feedback when reached latest workspace

When we already are in the first/last workspace and we try to swipe
left/right nothing happens. Provide a feedback and allow to drag the
workspace a little anyway. The gesture will bump back to the initial
workspace when completed.
This commit is contained in:
Alessandro Bono 2022-11-12 14:22:17 +01:00
parent 891243c62a
commit 48cdffe56b

View file

@ -14,6 +14,7 @@ import * as Util from '../misc/util.js';
import * as Main from './main.js';
const WINDOW_ANIMATION_TIME = 250;
const WORKSPACE_BUMP_RANGE = 0.1;
export const WORKSPACE_SPACING = 100;
export const WorkspaceGroup = GObject.registerClass(
@ -477,7 +478,7 @@ export class WorkspaceAnimationController {
this._switchData.baseMonitorGroup = monitorGroup;
tracker.confirmSwipe(baseDistance, points, progress, cancelProgress);
tracker.confirmSwipe(baseDistance, points, progress, cancelProgress, WORKSPACE_BUMP_RANGE);
}
_switchWorkspaceUpdate(tracker, progress) {