summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop-electron/src/main/windows.ts
diff options
context:
space:
mode:
authorBrendan Allan <[email protected]>2026-03-13 09:18:27 +0800
committerGitHub <[email protected]>2026-03-13 09:18:27 +0800
commit84df96eaefe7a920b48b205501fc849ba027e9ad (patch)
tree65ac52fde124e5cde48f56bba46c2d7fc1c2f070 /packages/desktop-electron/src/main/windows.ts
parentd9dd33aeebad49120ea8204e34520db872c9f553 (diff)
downloadopencode-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.ts14
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(