mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-12 03:31:29 +03:00
opt: hide main window when using shortcut
This commit is contained in:
@@ -420,7 +420,17 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
// initTray();
|
||||
trayManager.addListener(this);
|
||||
rustDeskWinManager.registerActiveWindowListener(onActiveWindowChanged);
|
||||
rustDeskWinManager.registerActiveWindow(0);
|
||||
// main window may be hidden because of the initial uni link or arguments.
|
||||
// note that we must wrap this active window registration in future because
|
||||
// we must ensure the execution is after `windowManager.hide/show()`.
|
||||
Future.delayed(Duration.zero, () {
|
||||
windowManager.isVisible().then((visibility) {
|
||||
if (visibility) {
|
||||
rustDeskWinManager.registerActiveWindow(kWindowMainId);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
rustDeskWinManager.setMethodHandler((call, fromWindowId) async {
|
||||
debugPrint(
|
||||
"[Main] call ${call.method} with args ${call.arguments} from window $fromWindowId");
|
||||
@@ -455,9 +465,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
rustDeskWinManager.unregisterActiveWindow(call.arguments["id"]);
|
||||
}
|
||||
});
|
||||
Future.delayed(Duration.zero, () {
|
||||
checkArguments();
|
||||
});
|
||||
_uniLinksSubscription = listenUniLinks();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user