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

Method applyLayout

packages/config/src/window-manager.ts:3383–3478  ·  view source on GitHub ↗
(options: LayoutOptions = {})

Source from the content-addressed store, hash-verified

3381 window.unmaximize();
3382 }
3383 playRectAnimation(
3384 window,
3385 WINDOW_STATE_RECT,
3386 snap.rect,
3387 WINDOW_MANAGEMENT_EASING,
3388 WINDOW_MANAGEMENT_ANIMATION_DURATION,
3389 );
3390 this.setWindowSnapState(workspace, window, snap.monitor, snap.zone);
3391 workspace?.syncFloatingWindowRect(window, snap.rect);
3392 }
3393 this.applyWorkspaceStackPolicy(workspace);
3394 return true;
3395 }
3396}
3397
3398export class Workspace {
3399 public index: number;
3400 private readonly windows: WaylandWindow[] = [];
3401 private readonly naturalRootRect: (
3402 window: WaylandWindow,
3403 ) => ManagedWindowRect;
3404 private readonly maximizedRootRect: (
3405 window: WaylandWindow,
3406 ) => ManagedWindowRect;
3407 private readonly activeWorkspaceIndex: (monitor: string) => number;
3408 private readonly tileWidthByWindowId = new Map<string, number>();
3409 private readonly restoredWindowStateById = new Map<
3410 string,
3411 WorkspaceWindowSnapshot
3412 >();
3413 private activeWindowId: string | null = null;
3414 private visibilityAnimationToken = 0;
3415 private draggingWindowId: string | null = null;
3416 // Layout slot reserved for the tile being dragged (the gap opened in the row).
3417 // Captured during applyLayout so the bar can preview where the tile will land.
3418 private lastDraggingSlotRect: ManagedWindowRect | null = null;
3419 private lastAppliedTileViewportRect: ManagedWindowRect | null = null;
3420 private scrollOffset = 0;
3421 private readonly initialTileStateByWindowId = new Map<
3422 string,
3423 {
3424 scrollOffset: number;
3425 activeWindowId: string | null;
3426 token: number;
3427 }
3428 >();
3429 private initialTileStateToken = 0;
3430 private readonly tileReorderTokenByWindowId = new Map<string, number>();
3431 private tileReorderToken = 0;
3432 private kineticScrollPoll: PollHandle | null = null;
3433 private kineticScrollToken = 0;
3434 public monitor: string;
3435 public isTiled = false;
3436
3437 public constructor(
3438 index: number,
3439 monitor: string,
3440 naturalRootRect: (window: WaylandWindow) => ManagedWindowRect,

Callers 15

addWindowMethod · 0.95
moveFocusedTileMethod · 0.95
setTiledMethod · 0.95
resizeTileMethod · 0.95
beginTileDragMethod · 0.95
updateTileDragMethod · 0.95
endTileDragMethod · 0.95
focusWindowMethod · 0.95
panToWindowMethod · 0.95
applyMethod · 0.95

Calls 15

tileableWindowsMethod · 0.95
floatingWindowsMethod · 0.95
applyFloatingLayoutMethod · 0.95
clampScrollOffsetMethod · 0.95
tileViewportRectMethod · 0.95
tileWidthForWindowMethod · 0.95
fullscreenRootRectMethod · 0.95
maximizedTileRectMethod · 0.95
readFunction · 0.90
playRectAnimationFunction · 0.90
stopRectAnimationFunction · 0.90

Tested by

no test coverage detected