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>
This commit is contained in:
@@ -466,9 +466,20 @@ function queueWindowModeSwitch(
|
|||||||
|
|
||||||
async function openSettingsWindow(): Promise<void> {
|
async function openSettingsWindow(): Promise<void> {
|
||||||
const window = await ensureSettingsWindow();
|
const window = await ensureSettingsWindow();
|
||||||
|
const parent = settingsWindowParent();
|
||||||
|
if (parent && window.getParentWindow() !== parent) {
|
||||||
|
window.setParentWindow(parent);
|
||||||
|
}
|
||||||
await revealWindow(window);
|
await revealWindow(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function settingsWindowParent(): ElectronBrowserWindow | undefined {
|
||||||
|
if (process.platform !== "win32") {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return currentMainWindow() ?? undefined;
|
||||||
|
}
|
||||||
|
|
||||||
function rendererURL(): string | null {
|
function rendererURL(): string | null {
|
||||||
return process.env.ELECTRON_RENDERER_URL ?? null;
|
return process.env.ELECTRON_RENDERER_URL ?? null;
|
||||||
}
|
}
|
||||||
@@ -598,6 +609,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,
|
||||||
|
|||||||
Reference in New Issue
Block a user