MCPcopy
hub / github.com/marktext/marktext / remove

Method remove

packages/desktop/src/main/app/windowManager.ts:166–179  ·  view source on GitHub ↗

* Remove the given window by id. * * NOTE: All window "window-focus" events listeners are removed!

(windowId: number)

Source from the content-addressed store, hash-verified

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) {

Callers 7

addMethod · 0.95
forceCloseMethod · 0.95
clearupMethod · 0.45
clearFunction · 0.45
removeFunction · 0.45
clickFunction · 0.45
addThemeStyleFunction · 0.45

Calls 5

getMethod · 0.95
setActiveWindowMethod · 0.95
removeAllListenersMethod · 0.80
deleteMethod · 0.80
getNewestMethod · 0.80

Tested by

no test coverage detected