fix connect on subwindow, notify main window

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-12-01 13:52:12 +08:00
parent 1f4d45edaf
commit 7c09e66902
5 changed files with 44 additions and 11 deletions

View File

@@ -500,9 +500,9 @@ class _DesktopHomePageState extends State<DesktopHomePage>
rustDeskWinManager.setMethodHandler((call, fromWindowId) async {
debugPrint(
"[Main] call ${call.method} with args ${call.arguments} from window $fromWindowId");
if (call.method == "main_window_on_top") {
if (call.method == kWindowMainWindowOnTop) {
window_on_top(null);
} else if (call.method == "get_window_info") {
} else if (call.method == kWindowGetWindowInfo) {
final screen = (await window_size.getWindowInfo()).screen;
if (screen == null) {
return "";
@@ -529,6 +529,13 @@ class _DesktopHomePageState extends State<DesktopHomePage>
rustDeskWinManager.registerActiveWindow(call.arguments["id"]);
} else if (call.method == kWindowEventHide) {
rustDeskWinManager.unregisterActiveWindow(call.arguments["id"]);
} else if (call.method == kWindowConnect) {
await connectMainDesktop(
call.arguments['id'],
isFileTransfer: call.arguments['isFileTransfer'],
isTcpTunneling: call.arguments['isTcpTunneling'],
isRDP: call.arguments['isRDP'],
);
}
});
_uniLinksSubscription = listenUniLinks();