* Remove the given window by id. * * NOTE: All window "window-focus" events listeners are removed!
(windowId: number)
| 164 | * NOTE: All window "window-focus" events listeners are removed! |
| 165 | */ |
| 166 | remove(windowId: number): BaseWindow | undefined { |
| 167 | const { _windows } = this |
| 168 | const window = this.get(windowId) |
| 169 | if (window) { |
| 170 | window.removeAllListeners('window-focus') |
| 171 | |
| 172 | this._windowActivity.delete(windowId) |
| 173 | const nextWindowId = this._windowActivity.getNewest() |
| 174 | this.setActiveWindow(nextWindowId) |
| 175 | |
| 176 | _windows.delete(windowId) |
| 177 | } |
| 178 | return window |
| 179 | } |
| 180 | |
| 181 | setActiveWindow(windowId: number | null): void { |
| 182 | if (this._activeWindowId !== windowId) { |
no test coverage detected