(window: WaylandWindow)
| 3636 | * |
| 3637 | * "The tile that slid into its place" is only an answer for a tile in a |
| 3638 | * tiled workspace. Anywhere else — a floating workspace, or a dialog that |
| 3639 | * never held a slot — there is no next-one-along to name, and naming one |
| 3640 | * anyway is what sent focus to the wrong window: dismissing an SSH approval |
| 3641 | * prompt jumped to the password manager's main window instead of returning |
| 3642 | * to the terminal that had asked for it. |
| 3643 | * |
| 3644 | * Declining is not caution, it is the better answer. The compositor elects |
| 3645 | * the window the user most recently typed in or clicked on, which is what |
| 3646 | * "put me back where I was" means, and is something this layer cannot work |
| 3647 | * out for itself: it focuses every window at onOpen, so "was focused" cannot |
| 3648 | * separate a terminal in use from a dialog that appeared beside it. |
| 3649 | */ |
| 3650 | private successorForRemovedWindow( |
| 3651 | wasTile: boolean, |
| 3652 | tileIndex: number, |
| 3653 | ): WaylandWindow | null { |
| 3654 | if (!this.isTiled || !wasTile || tileIndex < 0) { |
| 3655 | return null; |
| 3656 | } |
| 3657 | const tileable = this.tileableWindows(); |
| 3658 | return tileable[Math.min(tileIndex, tileable.length - 1)] ?? null; |
| 3659 | } |
| 3660 | |
| 3661 | public removeTileDragWindow(window: WaylandWindow) { |
| 3662 | const index = this.windows.findIndex((current) => current.id === window.id); |
| 3663 | if (index < 0) { |
| 3664 | return; |
| 3665 | } |
| 3666 | this.windows.splice(index, 1); |
| 3667 | this.draggingWindowId = null; |
| 3668 | } |
| 3669 | |
| 3670 | public removeFloatingWindow(window: WaylandWindow) { |
| 3671 | const index = this.windows.findIndex((current) => current.id === window.id); |
| 3672 | if (index < 0) { |
no test coverage detected