MCPcopy Create free account
hub / github.com/bea4dev/ShojiWM / scrollBy

Method scrollBy

packages/config/src/window-manager.ts:3726–3765  ·  view source on GitHub ↗
(
    deltaX: number,
    options: {
      stopKinetic?: boolean;
      suppressSSDRebuild?: boolean;
      cancelRectAnimations?: boolean;
    } = {},
  )

Source from the content-addressed store, hash-verified

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);

Callers 2

stepMethod · 0.95

Calls 6

stopKineticScrollMethod · 0.95
tileableWindowsMethod · 0.95
clampScrollOffsetMethod · 0.95
markManagedWindowDirtyFunction · 0.90
applyFunction · 0.85

Tested by

no test coverage detected