diff --git a/packages/app/src/components/titlebar.tsx b/packages/app/src/components/titlebar.tsx index 1a2a8a81b6d4..61be7da1cc42 100644 --- a/packages/app/src/components/titlebar.tsx +++ b/packages/app/src/components/titlebar.tsx @@ -84,8 +84,8 @@ export function Titlebar(props: { update?: TitlebarUpdate }) { const mac = createMemo(() => platform.platform === "desktop" && platform.os === "macos") const windows = createMemo(() => platform.platform === "desktop" && platform.os === "windows") - const electronWindows = createMemo(() => windows() && !tauriApi()) const linux = createMemo(() => platform.platform === "desktop" && platform.os === "linux") + const electronWindows = createMemo(() => (windows() || linux()) && !tauriApi()) const web = createMemo(() => platform.platform === "web") const zoom = () => platform.webviewZoom?.() ?? 1 const titlebarZoom = () => (windows() ? Math.max(zoom(), minTitlebarZoom) : zoom()) diff --git a/packages/desktop/src/main/windows.ts b/packages/desktop/src/main/windows.ts index 7a594b5302e9..d80d1bc0ea7c 100644 --- a/packages/desktop/src/main/windows.ts +++ b/packages/desktop/src/main/windows.ts @@ -76,6 +76,7 @@ export function setBackgroundColor(color: string) { BrowserWindow.getAllWindows().forEach((win) => { win.setBackgroundColor(color) if (process.platform === "darwin") win.invalidateShadow() + if (process.platform === "linux") updateTitlebar(win) }) } @@ -103,7 +104,7 @@ function defaultBackgroundColor() { function overlay(theme: Partial = {}, zoom = 1) { const mode = theme.mode ?? tone() return { - color: "#00000000", + color: process.platform === "linux" ? (backgroundColor ?? defaultBackgroundColor()) : "#00000000", symbolColor: mode === "dark" ? "white" : "black", height: Math.max(titlebarHeight, Math.round(titlebarHeight * zoom)), } @@ -122,7 +123,7 @@ export function setTitlebar(win: BrowserWindow, theme: Partial = } export function updateTitlebar(win: BrowserWindow) { - if (process.platform !== "win32") return + if (process.platform !== "win32" && process.platform !== "linux") return win.setTitleBarOverlay(overlay(titlebarThemes.get(win), win.webContents.getZoomFactor())) } @@ -187,7 +188,7 @@ export function createMainWindow(id: string = randomUUID()) { trafficLightPosition: { x: 14, y: 14 }, } : {}), - ...(process.platform === "win32" + ...(process.platform === "win32" || process.platform === "linux" ? { frame: false, titleBarStyle: "hidden" as const,