mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-13 11:09:17 +08:00
Merge pull request #5730 from 21pages/mac_tray
remove mac tray session count tooltip
This commit is contained in:
commit
3b68f598b1
@ -233,7 +233,7 @@ pub enum Data {
|
|||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
SyncWinCpuUsage(Option<f64>),
|
SyncWinCpuUsage(Option<f64>),
|
||||||
FileTransferLog(String),
|
FileTransferLog(String),
|
||||||
#[cfg(any(windows, target_os = "macos"))]
|
#[cfg(windows)]
|
||||||
ControlledSessionCount(usize),
|
ControlledSessionCount(usize),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -483,7 +483,7 @@ async fn handle(data: Data, stream: &mut Connection) {
|
|||||||
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
||||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||||
Data::Plugin(plugin) => crate::plugin::ipc::handle_plugin(plugin, stream).await,
|
Data::Plugin(plugin) => crate::plugin::ipc::handle_plugin(plugin, stream).await,
|
||||||
#[cfg(any(windows, target_os = "macos"))]
|
#[cfg(windows)]
|
||||||
Data::ControlledSessionCount(_) => {
|
Data::ControlledSessionCount(_) => {
|
||||||
allow_err!(
|
allow_err!(
|
||||||
stream
|
stream
|
||||||
|
@ -76,7 +76,7 @@ pub fn make_tray() -> hbb_common::ResultType<()> {
|
|||||||
|
|
||||||
let menu_channel = MenuEvent::receiver();
|
let menu_channel = MenuEvent::receiver();
|
||||||
let tray_channel = TrayEvent::receiver();
|
let tray_channel = TrayEvent::receiver();
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(windows)]
|
||||||
let (ipc_sender, ipc_receiver) = std::sync::mpsc::channel::<Data>();
|
let (ipc_sender, ipc_receiver) = std::sync::mpsc::channel::<Data>();
|
||||||
let mut docker_hiden = false;
|
let mut docker_hiden = false;
|
||||||
|
|
||||||
@ -108,8 +108,7 @@ pub fn make_tray() -> hbb_common::ResultType<()> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// ubuntu 22.04 can't see tooltip
|
#[cfg(windows)]
|
||||||
#[cfg(not(target_os = "linux"))]
|
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
start_query_session_count(ipc_sender.clone());
|
start_query_session_count(ipc_sender.clone());
|
||||||
});
|
});
|
||||||
@ -146,7 +145,7 @@ pub fn make_tray() -> hbb_common::ResultType<()> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(windows)]
|
||||||
if let Ok(data) = ipc_receiver.try_recv() {
|
if let Ok(data) = ipc_receiver.try_recv() {
|
||||||
match data {
|
match data {
|
||||||
Data::ControlledSessionCount(count) => {
|
Data::ControlledSessionCount(count) => {
|
||||||
@ -162,7 +161,7 @@ pub fn make_tray() -> hbb_common::ResultType<()> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(windows)]
|
||||||
#[tokio::main(flavor = "current_thread")]
|
#[tokio::main(flavor = "current_thread")]
|
||||||
async fn start_query_session_count(sender: std::sync::mpsc::Sender<Data>) {
|
async fn start_query_session_count(sender: std::sync::mpsc::Sender<Data>) {
|
||||||
let mut last_count = 0;
|
let mut last_count = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user