mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-06-25 17:54:55 +03:00
Fix tray icon click (regression due to breaking change in tray-icon 0.17) (#15413)
This commit is contained in:
17
src/tray.rs
17
src/tray.rs
@@ -143,12 +143,21 @@ fn make_tray() -> hbb_common::ResultType<()> {
|
||||
}
|
||||
// We create the icon once the event loop is actually running
|
||||
// to prevent issues like https://github.com/tauri-apps/tray-icon/issues/90
|
||||
let tray = TrayIconBuilder::new()
|
||||
let mut builder = TrayIconBuilder::new()
|
||||
.with_menu(Box::new(tray_menu.clone()))
|
||||
.with_tooltip(tooltip(0))
|
||||
.with_icon(icon.clone())
|
||||
.with_icon_as_template(true) // mac only
|
||||
.build();
|
||||
.with_icon(icon.clone());
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
builder = builder.with_icon_as_template(true);
|
||||
}
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
// Required since tray-icon 0.17
|
||||
// Fixes #15215, #15222, #15410
|
||||
builder = builder.with_menu_on_left_click(false);
|
||||
}
|
||||
let tray = builder.build();
|
||||
match tray {
|
||||
Ok(tray) => _tray_icon = Arc::new(Mutex::new(Some(tray))),
|
||||
Err(err) => {
|
||||
|
||||
Reference in New Issue
Block a user