diff options
| author | Brendan Allan <[email protected]> | 2026-03-13 09:18:27 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-13 09:18:27 +0800 |
| commit | 84df96eaefe7a920b48b205501fc849ba027e9ad (patch) | |
| tree | 65ac52fde124e5cde48f56bba46c2d7fc1c2f070 /packages/desktop-electron/src/main/windows.ts | |
| parent | d9dd33aeebad49120ea8204e34520db872c9f553 (diff) | |
| download | opencode-84df96eaefe7a920b48b205501fc849ba027e9ad.tar.gz opencode-84df96eaefe7a920b48b205501fc849ba027e9ad.zip | |
desktop: multi-window support in electron (#17155)
Diffstat (limited to 'packages/desktop-electron/src/main/windows.ts')
| -rw-r--r-- | packages/desktop-electron/src/main/windows.ts | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/packages/desktop-electron/src/main/windows.ts b/packages/desktop-electron/src/main/windows.ts index d4ec5ac79..0b7783f28 100644 --- a/packages/desktop-electron/src/main/windows.ts +++ b/packages/desktop-electron/src/main/windows.ts @@ -6,12 +6,21 @@ import type { TitlebarTheme } from "../preload/types" type Globals = { updaterEnabled: boolean - wsl: boolean deepLinks?: string[] } const root = dirname(fileURLToPath(import.meta.url)) +let backgroundColor: string | undefined + +export function setBackgroundColor(color: string) { + backgroundColor = color +} + +export function getBackgroundColor(): string | undefined { + return backgroundColor +} + function iconsDir() { return app.isPackaged ? join(process.resourcesPath, "icons") : join(root, "../../resources/icons") } @@ -59,6 +68,7 @@ export function createMainWindow(globals: Globals) { show: true, title: "OpenCode", icon: iconPath(), + backgroundColor, ...(process.platform === "darwin" ? { titleBarStyle: "hidden" as const, @@ -95,6 +105,7 @@ export function createLoadingWindow(globals: Globals) { center: true, show: true, icon: iconPath(), + backgroundColor, ...(process.platform === "darwin" ? { titleBarStyle: "hidden" as const } : {}), ...(process.platform === "win32" ? { @@ -131,7 +142,6 @@ function injectGlobals(win: BrowserWindow, globals: Globals) { const deepLinks = globals.deepLinks ?? [] const data = { updaterEnabled: globals.updaterEnabled, - wsl: globals.wsl, deepLinks: Array.isArray(deepLinks) ? deepLinks.splice(0) : deepLinks, } void win.webContents.executeJavaScript( |
