From 579e0fac3632892197edf8fba684ee9d93ec09e6 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Fri, 16 Aug 2024 12:20:40 +0800 Subject: [PATCH] fix https://github.com/rustdesk/rustdesk/issues/9088 --- flutter/lib/main.dart | 6 +++--- flutter/lib/web/bridge.dart | 2 +- flutter/macos/Runner/Info.plist | 2 ++ src/flutter_ffi.rs | 2 +- src/platform/macos.rs | 1 - src/tray.rs | 1 - 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/flutter/lib/main.dart b/flutter/lib/main.dart index 0386d63cf..c2009bcae 100644 --- a/flutter/lib/main.dart +++ b/flutter/lib/main.dart @@ -260,7 +260,7 @@ showCmWindow({bool isStartup = false}) async { WindowOptions windowOptions = getHiddenTitleBarWindowOptions( size: kConnectionManagerWindowSizeClosedChat, alwaysOnTop: true); await windowManager.waitUntilReadyToShow(windowOptions, null); - bind.mainHideDocker(); + bind.mainHideDock(); await Future.wait([ windowManager.show(), windowManager.focus(), @@ -288,14 +288,14 @@ hideCmWindow({bool isStartup = false}) async { size: kConnectionManagerWindowSizeClosedChat); windowManager.setOpacity(0); await windowManager.waitUntilReadyToShow(windowOptions, null); - bind.mainHideDocker(); + bind.mainHideDock(); await windowManager.minimize(); await windowManager.hide(); _isCmReadyToShow = true; } else if (_isCmReadyToShow) { if (await windowManager.getOpacity() != 0) { await windowManager.setOpacity(0); - bind.mainHideDocker(); + bind.mainHideDock(); await windowManager.minimize(); await windowManager.hide(); } diff --git a/flutter/lib/web/bridge.dart b/flutter/lib/web/bridge.dart index 3f3846e08..457911458 100644 --- a/flutter/lib/web/bridge.dart +++ b/flutter/lib/web/bridge.dart @@ -1415,7 +1415,7 @@ class RustdeskImpl { return false; } - bool mainHideDocker({dynamic hint}) { + bool mainHideDock({dynamic hint}) { throw UnimplementedError(); } diff --git a/flutter/macos/Runner/Info.plist b/flutter/macos/Runner/Info.plist index d8f9db36c..36ca81e18 100644 --- a/flutter/macos/Runner/Info.plist +++ b/flutter/macos/Runner/Info.plist @@ -45,5 +45,7 @@ Record the sound from microphone for the purpose of the remote desktop. NSPrincipalClass NSApplication + LSUIElement + 1 diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 60f62e102..b64fd6044 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -1891,7 +1891,7 @@ pub fn main_is_login_wayland() -> SyncReturn { SyncReturn(is_login_wayland()) } -pub fn main_hide_docker() -> SyncReturn { +pub fn main_hide_dock() -> SyncReturn { #[cfg(target_os = "macos")] crate::platform::macos::hide_dock(); SyncReturn(true) diff --git a/src/platform/macos.rs b/src/platform/macos.rs index a6887c279..3d14485d2 100644 --- a/src/platform/macos.rs +++ b/src/platform/macos.rs @@ -493,7 +493,6 @@ pub fn lock_screen() { } pub fn start_os_service() { - crate::platform::macos::hide_dock(); log::info!("Username: {}", crate::username()); let mut sys = System::new(); let path = diff --git a/src/tray.rs b/src/tray.rs index 3a879801e..74c18bf7b 100644 --- a/src/tray.rs +++ b/src/tray.rs @@ -12,7 +12,6 @@ pub fn start_tray() { if crate::ui_interface::get_builtin_option(hbb_common::config::keys::OPTION_HIDE_TRAY) == "Y" { #[cfg(target_os = "macos")] { - crate::platform::macos::hide_dock(); loop { std::thread::sleep(std::time::Duration::from_secs(1)); }