mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-07-10 17:25:09 +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
|
// We create the icon once the event loop is actually running
|
||||||
// to prevent issues like https://github.com/tauri-apps/tray-icon/issues/90
|
// 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_menu(Box::new(tray_menu.clone()))
|
||||||
.with_tooltip(tooltip(0))
|
.with_tooltip(tooltip(0))
|
||||||
.with_icon(icon.clone())
|
.with_icon(icon.clone());
|
||||||
.with_icon_as_template(true) // mac only
|
#[cfg(target_os = "macos")]
|
||||||
.build();
|
{
|
||||||
|
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 {
|
match tray {
|
||||||
Ok(tray) => _tray_icon = Arc::new(Mutex::new(Some(tray))),
|
Ok(tray) => _tray_icon = Arc::new(Mutex::new(Some(tray))),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user