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

Method centeredFloatingRect

packages/config/src/window-manager.ts:4121–4158  ·  view source on GitHub ↗
(window: WaylandWindow)

Source from the content-addressed store, hash-verified

4119 rect: ManagedWindowRect,
4120 pointerX: number,
4121 ) {
4122 if (this.draggingWindowId !== window.id) {
4123 this.beginTileDrag(window, rect);
4124 }
4125 this.activeWindowId = window.id;
4126 this.moveTileWindowToIndex(
4127 window,
4128 this.tileInsertionIndexForPointer(window, pointerX),
4129 );
4130 stopRectAnimation(window, WINDOW_STATE_RECT);
4131 window.state[WINDOW_STATE_RECT].set(rect);
4132 this.scrollToWindow(window);
4133 this.applyLayout();
4134 }
4135
4136 public endTileDrag(window: WaylandWindow, cancelled: boolean) {
4137 if (this.draggingWindowId !== window.id) {
4138 return;
4139 }
4140 this.draggingWindowId = null;
4141 window.state[WINDOW_STATE_TILE_DRAGGING].set(false);
4142 this.syncWindowVisibleOutputs(window);
4143 window.state[WINDOW_STATE_WORKSPACE_OFFSET_Y].set(0);
4144 window.state[WINDOW_STATE_WORKSPACE_OPACITY].set(this.isActive() ? 1 : 0);
4145 if (!cancelled) {
4146 this.activeWindowId = window.id;
4147 this.scrollToWindow(window);
4148 }
4149 this.applyLayout();
4150 if (!cancelled && this.isActive()) {
4151 window.focus();
4152 }
4153 }
4154
4155 public focusWindow(window: WaylandWindow) {
4156 if (!this.shouldTile(window)) {
4157 return;
4158 }
4159 if (this.activeWindowId === window.id) {
4160 return;
4161 }

Callers 2

addWindowMethod · 0.95
applyFloatingLayoutMethod · 0.95

Calls 2

readFunction · 0.90
usableAreaMethod · 0.80

Tested by

no test coverage detected