Merge pull request #3320 from Kingtous/master

fix: orderout not working when fullscreen on macos
This commit is contained in:
RustDesk 2023-02-22 09:26:49 +08:00 committed by GitHub
commit 78cbb487a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 5 deletions

View File

@ -548,13 +548,20 @@ class WindowActionPanelState extends State<WindowActionPanel>
if (rustDeskWinManager.getActiveWindows().contains(kMainWindowId)) { if (rustDeskWinManager.getActiveWindows().contains(kMainWindowId)) {
await rustDeskWinManager.unregisterActiveWindow(kMainWindowId); await rustDeskWinManager.unregisterActiveWindow(kMainWindowId);
} }
// `hide` must be placed after unregisterActiveWindow, because once all windows are hidden, // macOS specific workaround, the window is not hiding when in fullscreen.
// flutter closes the application on macOS. We should ensure the post-run logic has ran successfully. if (Platform.isMacOS && await windowManager.isFullScreen()) {
// e.g.: saving window position. await windowManager.setFullScreen(false);
await Future.delayed(Duration(seconds: 1));
}
await windowManager.hide(); await windowManager.hide();
} else { } else {
// it's safe to hide the subwindow // it's safe to hide the subwindow
await WindowController.fromWindowId(kWindowId!).hide(); final controller = WindowController.fromWindowId(kWindowId!);
if (Platform.isMacOS && await controller.isFullScreen()) {
await controller.setFullscreen(false);
await Future.delayed(Duration(seconds: 1));
}
await controller.hide();
await Future.wait([ await Future.wait([
rustDeskWinManager rustDeskWinManager
.call(WindowType.Main, kWindowEventHide, {"id": kWindowId!}), .call(WindowType.Main, kWindowEventHide, {"id": kWindowId!}),

View File

@ -59,7 +59,7 @@ dependencies:
desktop_multi_window: desktop_multi_window:
git: git:
url: https://github.com/Kingtous/rustdesk_desktop_multi_window url: https://github.com/Kingtous/rustdesk_desktop_multi_window
ref: bc8604a88e52b2b6e64d2661ae49a71450a47af8 ref: f37357ed98a10717576eb9ed8413e92b2ec5d13a
freezed_annotation: ^2.0.3 freezed_annotation: ^2.0.3
flutter_custom_cursor: ^0.0.4 flutter_custom_cursor: ^0.0.4
window_size: window_size:
@ -92,6 +92,7 @@ dependencies:
password_strength: ^0.2.0 password_strength: ^0.2.0
flutter_launcher_icons: ^0.11.0 flutter_launcher_icons: ^0.11.0
flutter_keyboard_visibility: ^5.4.0 flutter_keyboard_visibility: ^5.4.0
texture_rgba_renderer: ^0.0.8
dev_dependencies: dev_dependencies: