fix: show main window when hide to active
- Updated the onActivate method in LifecycleManager to ensure the main window is shown and focused when activated, improving user experience. - Added import for LifecycleManager in bootstrap.ts to support the new functionality. Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { app, BrowserWindow } from "electron"
|
||||
import { app } from "electron"
|
||||
|
||||
import { WindowManager } from "~/manager/window"
|
||||
|
||||
@@ -28,9 +28,9 @@ class LifecycleManagerStatic {
|
||||
}
|
||||
|
||||
private onActivate() {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
WindowManager.getMainWindowOrCreate()
|
||||
}
|
||||
const mainWindow = WindowManager.getMainWindowOrCreate()
|
||||
mainWindow.show()
|
||||
mainWindow.focus()
|
||||
}
|
||||
|
||||
public onReady(callback: () => void) {
|
||||
|
||||
Reference in New Issue
Block a user