fix: restore window, on connection (#8129)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-05-23 22:11:40 +08:00
committed by GitHub
parent 7da09f6296
commit 1efce51222
8 changed files with 16 additions and 46 deletions

View File

@@ -641,14 +641,12 @@ class WindowActionPanelState extends State<WindowActionPanel>
}
// macOS specific workaround, the window is not hiding when in fullscreen.
if (isMacOS && await windowManager.isFullScreen()) {
stateGlobal.closeOnFullscreen ??= true;
await windowManager.setFullScreen(false);
await macOSWindowClose(
() async => await windowManager.isFullScreen(),
mainWindowClose,
);
} else {
stateGlobal.closeOnFullscreen ??= false;
await mainWindowClose();
}
} else {
@@ -660,7 +658,6 @@ class WindowActionPanelState extends State<WindowActionPanel>
if (await widget.onClose?.call() ?? true) {
if (await controller.isFullScreen()) {
stateGlobal.closeOnFullscreen ??= true;
await controller.setFullscreen(false);
stateGlobal.setFullscreen(false, procWnd: false);
await macOSWindowClose(
@@ -668,7 +665,6 @@ class WindowActionPanelState extends State<WindowActionPanel>
() async => await notMainWindowClose(controller),
);
} else {
stateGlobal.closeOnFullscreen ??= false;
await notMainWindowClose(controller);
}
}