mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
Update to fix main window maximizing from splash
The code checks whether the initial window starts maximized; If so, it prevents the splash from starting maximized and leaves the main window maximized.
This commit is contained in:
parent
4d72392f1d
commit
1e84a1558f
1 changed files with 4 additions and 2 deletions
|
@ -19,8 +19,7 @@ export class WindowManager {
|
||||||
public static mainWindow: Electron.BrowserWindow | null = null;
|
public static mainWindow: Electron.BrowserWindow | null = null;
|
||||||
public static splashWindow: Electron.BrowserWindow | null = null;
|
public static splashWindow: Electron.BrowserWindow | null = null;
|
||||||
public static isReadyToShowMainWindow = false;
|
public static isReadyToShowMainWindow = false;
|
||||||
|
private static isMainMaximized = false;
|
||||||
private static isMainMaximize = false;
|
|
||||||
|
|
||||||
private static loadURL(hash = "") {
|
private static loadURL(hash = "") {
|
||||||
// HMR for renderer base on electron-vite cli.
|
// HMR for renderer base on electron-vite cli.
|
||||||
|
@ -100,13 +99,16 @@ export class WindowManager {
|
||||||
preload: path.join(__dirname, "../preload/index.mjs"),
|
preload: path.join(__dirname, "../preload/index.mjs"),
|
||||||
sandbox: false,
|
sandbox: false,
|
||||||
},
|
},
|
||||||
|
show: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.loadURL();
|
this.loadURL();
|
||||||
this.mainWindow.removeMenu();
|
this.mainWindow.removeMenu();
|
||||||
|
if (this.isMainMaximized) this.mainWindow?.maximize();
|
||||||
|
|
||||||
this.mainWindow.on("ready-to-show", () => {
|
this.mainWindow.on("ready-to-show", () => {
|
||||||
if (!app.isPackaged) WindowManager.mainWindow?.webContents.openDevTools();
|
if (!app.isPackaged) WindowManager.mainWindow?.webContents.openDevTools();
|
||||||
|
WindowManager.mainWindow?.show();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.mainWindow.on("close", async () => {
|
this.mainWindow.on("close", async () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue