From 0b9ca39c9f9e729fea7491270fa1a8fe7f42ab71 Mon Sep 17 00:00:00 2001 From: Xu Liang Date: Sat, 2 May 2026 14:42:36 +0800 Subject: [PATCH] fix(desktop-client): make settings window a child of main window on Windows Sets the settings window parent on creation and re-applies it on reveal so it stays modal to the main window on win32. Co-Authored-By: Claude Sonnet 4.6 --- apps/desktop-client/src/main/bootstrap.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/desktop-client/src/main/bootstrap.ts b/apps/desktop-client/src/main/bootstrap.ts index 525e26a..95f49fa 100644 --- a/apps/desktop-client/src/main/bootstrap.ts +++ b/apps/desktop-client/src/main/bootstrap.ts @@ -466,9 +466,20 @@ function queueWindowModeSwitch( async function openSettingsWindow(): Promise { const window = await ensureSettingsWindow(); + const parent = settingsWindowParent(); + if (parent && window.getParentWindow() !== parent) { + window.setParentWindow(parent); + } await revealWindow(window); } +function settingsWindowParent(): ElectronBrowserWindow | undefined { + if (process.platform !== "win32") { + return undefined; + } + return currentMainWindow() ?? undefined; +} + function rendererURL(): string | null { return process.env.ELECTRON_RENDERER_URL ?? null; } @@ -598,6 +609,7 @@ async function createSettingsWindow(): Promise { const initial = SETTINGS_WINDOW_SIZE; const backgroundColor = nativeTheme.shouldUseDarkColors ? "#15191a" : "#f2f4f7"; const window = new BrowserWindow({ + parent: settingsWindowParent(), width: initial.width, height: initial.height, minWidth: initial.minWidth,