mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-13 03:32:13 +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 splashWindow: Electron.BrowserWindow | null = null;
|
||||
public static isReadyToShowMainWindow = false;
|
||||
|
||||
private static isMainMaximize = false;
|
||||
private static isMainMaximized = false;
|
||||
|
||||
private static loadURL(hash = "") {
|
||||
// HMR for renderer base on electron-vite cli.
|
||||
|
@ -100,13 +99,16 @@ export class WindowManager {
|
|||
preload: path.join(__dirname, "../preload/index.mjs"),
|
||||
sandbox: false,
|
||||
},
|
||||
show: false,
|
||||
});
|
||||
|
||||
this.loadURL();
|
||||
this.mainWindow.removeMenu();
|
||||
if (this.isMainMaximized) this.mainWindow?.maximize();
|
||||
|
||||
this.mainWindow.on("ready-to-show", () => {
|
||||
if (!app.isPackaged) WindowManager.mainWindow?.webContents.openDevTools();
|
||||
WindowManager.mainWindow?.show();
|
||||
});
|
||||
|
||||
this.mainWindow.on("close", async () => {
|
||||
|
|
Loading…
Reference in a new issue