MCPcopy
hub / github.com/anomalyco/opencode / registerWindow

Function registerWindow

packages/desktop/src/main/windows.ts:214–227  ·  view source on GitHub ↗
(win: BrowserWindow, id: string)

Source from the content-addressed store, hash-verified

212}
213
214function registerWindow(win: BrowserWindow, id: string) {
215 windowIDs.set(win, id)
216 windowsByID.set(id, win)
217 persistWindowID(id)
218
219 win.on("focus", () => {
220 lastFocusedWindowID = id
221 })
222 win.on("closed", () => {
223 windowsByID.delete(id)
224 if (lastFocusedWindowID === id) lastFocusedWindowID = windowsByID.keys().next().value
225 if (!appQuitting) removeWindowID(id)
226 })
227}
228
229function readWindowIDs() {
230 const value = getStore().get(WINDOW_IDS_KEY)

Callers 1

createMainWindowFunction · 0.85

Calls 6

persistWindowIDFunction · 0.85
removeWindowIDFunction · 0.85
onMethod · 0.80
setMethod · 0.45
deleteMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected