From 45513834749b5e800936244dcf2f766a7f2c223b Mon Sep 17 00:00:00 2001 From: fufesou Date: Thu, 27 Oct 2022 15:52:40 +0800 Subject: [PATCH] win_fix_multi_tab: debug flutter done Signed-off-by: fufesou --- flutter/lib/desktop/pages/remote_tab_page.dart | 10 +++------- src/ui_cm_interface.rs | 5 +++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/flutter/lib/desktop/pages/remote_tab_page.dart b/flutter/lib/desktop/pages/remote_tab_page.dart index b3ebb5497..93008de07 100644 --- a/flutter/lib/desktop/pages/remote_tab_page.dart +++ b/flutter/lib/desktop/pages/remote_tab_page.dart @@ -24,8 +24,9 @@ class ConnectionTabPage extends StatefulWidget { } class _ConnectionTabPageState extends State { - final tabController = - Get.put(DesktopTabController(tabType: DesktopTabType.remoteScreen)); + final tabController = Get.put(DesktopTabController( + tabType: DesktopTabType.remoteScreen, + onSelected: (_, id) => bind.setCurSessionId(id: id))); static const IconData selectedIcon = Icons.desktop_windows_sharp; static const IconData unselectedIcon = Icons.desktop_windows_outlined; @@ -60,7 +61,6 @@ class _ConnectionTabPageState extends State { super.initState(); tabController.onRemoved = (_, id) => onRemoveId(id); - tabController.onSelected = (_, id) => onSelectId(id); rustDeskWinManager.setMethodHandler((call, fromWindowId) async { print( @@ -175,10 +175,6 @@ class _ConnectionTabPageState extends State { _update_remote_count(); } - void onSelectId(String id) { - bind.setCurSessionId(id: id); - } - int windowId() { return widget.params["windowId"]; } diff --git a/src/ui_cm_interface.rs b/src/ui_cm_interface.rs index c14a4f0c7..7296f8738 100644 --- a/src/ui_cm_interface.rs +++ b/src/ui_cm_interface.rs @@ -320,8 +320,9 @@ impl IpcTaskRunner { log::info!("cm ipc connection disconnect"); break; } - Data::PrivacyModeState((id, _)) => { - cm_inner_send(id, data); + Data::PrivacyModeState((_id, _)) => { + #[cfg(windows)] + cm_inner_send(_id, data); } Data::ClickTime(ms) => { CLICK_TIME.store(ms, Ordering::SeqCst);