Compare commits
2 Commits
cd5f038108
...
3ee87fd91e
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ee87fd91e | |||
| 0b9ca39c9f |
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user