Merge pull request #4012 from 21pages/fix

minimize cm before hide to send focus back
This commit is contained in:
RustDesk 2023-04-11 10:25:25 +08:00 committed by GitHub
commit 12f3691645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,8 +134,7 @@ void runMainApp(bool startService) async {
await restoreWindowPosition(WindowType.Main); await restoreWindowPosition(WindowType.Main);
// Check the startup argument, if we successfully handle the argument, we keep the main window hidden. // Check the startup argument, if we successfully handle the argument, we keep the main window hidden.
final handledByUniLinks = await initUniLinks(); final handledByUniLinks = await initUniLinks();
debugPrint( debugPrint("handled by uni links: $handledByUniLinks");
"handled by uni links: $handledByUniLinks");
if (handledByUniLinks || checkArguments()) { if (handledByUniLinks || checkArguments()) {
windowManager.hide(); windowManager.hide();
} else { } else {
@ -249,6 +248,7 @@ void hideCmWindow() {
windowManager.setOpacity(0); windowManager.setOpacity(0);
windowManager.waitUntilReadyToShow(windowOptions, () async { windowManager.waitUntilReadyToShow(windowOptions, () async {
bind.mainHideDocker(); bind.mainHideDocker();
await windowManager.minimize();
await windowManager.hide(); await windowManager.hide();
}); });
} }