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);