(
deltaX: number,
options: {
stopKinetic?: boolean;
suppressSSDRebuild?: boolean;
cancelRectAnimations?: boolean;
} = {},
)
| 3724 | const nextIndex = currentIndex + direction; |
| 3725 | if (nextIndex < 0 || nextIndex >= tileable.length) { |
| 3726 | return false; |
| 3727 | } |
| 3728 | |
| 3729 | this.stopKineticScroll(); |
| 3730 | this.activeWindowId = focused.id; |
| 3731 | this.markTileReordering(focused); |
| 3732 | this.moveTileWindowToIndex(focused, nextIndex); |
| 3733 | this.scrollToWindow(focused); |
| 3734 | this.applyLayout(); |
| 3735 | focused.focus(); |
| 3736 | return true; |
| 3737 | } |
| 3738 | |
| 3739 | private markTileReordering(window: WaylandWindow): void { |
| 3740 | const token = ++this.tileReorderToken; |
| 3741 | this.tileReorderTokenByWindowId.set(window.id, token); |
| 3742 | window.state[WINDOW_STATE_TILE_REORDERING].set(true); |
| 3743 | setTimeout(() => { |
| 3744 | if (this.tileReorderTokenByWindowId.get(window.id) !== token) { |
| 3745 | return; |
| 3746 | } |
| 3747 | this.tileReorderTokenByWindowId.delete(window.id); |
| 3748 | window.state[WINDOW_STATE_TILE_REORDERING].set(false); |
| 3749 | }, TILE_ANIMATION_DURATION); |
| 3750 | } |
| 3751 | |
| 3752 | public takeWindowForMove( |
| 3753 | window: WaylandWindow, |
| 3754 | ): { window: WaylandWindow; snapshot: WorkspaceWindowSnapshot } | null { |
| 3755 | if (!this.hasWindow(window)) { |
| 3756 | return null; |
| 3757 | } |
| 3758 | |
| 3759 | const snapshot = this.snapshotWindow(window); |
| 3760 | this.removeWindow(window); |
| 3761 | return { window, snapshot }; |
| 3762 | } |
| 3763 | |
| 3764 | public addMovedWindow( |
| 3765 | window: WaylandWindow, |
| 3766 | snapshot: WorkspaceWindowSnapshot, |
| 3767 | ): boolean { |
| 3768 | this.restoredWindowStateById.set(window.id, snapshot); |
no test coverage detected