* Get the currently focused window
()
| 97 | * Get the currently focused window |
| 98 | */ |
| 99 | getFocused(): BrowserWindow | null { |
| 100 | if (this.focusedWindowId !== null) { |
| 101 | const win = this.windows.get(this.focusedWindowId) |
| 102 | if (win && !win.isDestroyed()) { |
| 103 | return win |
| 104 | } |
| 105 | } |
| 106 | // Fallback to BrowserWindow.getFocusedWindow() with destroyed check |
| 107 | const focusedWin = BrowserWindow.getFocusedWindow() |
| 108 | if (focusedWin && !focusedWin.isDestroyed()) { |
| 109 | return focusedWin |
| 110 | } |
| 111 | return null |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Get all windows |
no test coverage detected