(options: LayoutOptions = {})
| 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 | |
| 3398 | export 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, |
no test coverage detected