Compare commits

...

2 Commits

Author SHA1 Message Date
Xu Liang 3ee87fd91e chore: resolve merge conflict in bootstrap.ts
Keep settings window parent logic for Windows during merge with remote.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 14:44:23 +08:00
Xu Liang 0b9ca39c9f 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 <noreply@anthropic.com>
2026-05-02 14:42:36 +08:00
+14 -2
View File
@@ -478,8 +478,19 @@ function queueWindowModeSwitch(
} }
async function openSettingsWindow(): Promise<void> { async function openSettingsWindow(): Promise<void> {
const window = await ensureSettingsWindow() const window = await ensureSettingsWindow();
await revealWindow(window) 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 { function rendererURL(): string | null {
@@ -618,6 +629,7 @@ async function createSettingsWindow(): Promise<ElectronBrowserWindow> {
const initial = SETTINGS_WINDOW_SIZE const initial = SETTINGS_WINDOW_SIZE
const backgroundColor = nativeTheme.shouldUseDarkColors ? '#15191a' : '#f2f4f7' const backgroundColor = nativeTheme.shouldUseDarkColors ? '#15191a' : '#f2f4f7'
const window = new BrowserWindow({ const window = new BrowserWindow({
parent: settingsWindowParent(),
width: initial.width, width: initial.width,
height: initial.height, height: initial.height,
minWidth: initial.minWidth, minWidth: initial.minWidth,