Skip to content

Commit

Permalink
fix: declare tray_icon as mut for windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Oct 26, 2024
1 parent 0b57ac2 commit 472780d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/desktop/src/sys_tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ impl SysTray {
async fn create_tray_icon(&self) -> anyhow::Result<TrayIcon> {
let tooltip = format!("Zebar v{}", env!("VERSION_NUMBER"));

let tray_icon = TrayIconBuilder::with_id("tray")
// Linting: `mut` needed for Windows where `tray_icon` is modified with
// additional click handler.
#[allow(unused_mut)]
let mut tray_icon = TrayIconBuilder::with_id("tray")
.icon(self.icon_image()?)
.menu(&self.create_tray_menu().await?)
.tooltip(tooltip)
Expand All @@ -155,7 +158,7 @@ impl SysTray {
// Show the settings window on left click (Windows-only).
#[cfg(windows)]
{
let tray_icon =
tray_icon =
tray_icon.menu_on_left_click(false).on_tray_icon_event({
let app_handle = self.app_handle.clone();
let config = self.config.clone();
Expand Down

0 comments on commit 472780d

Please sign in to comment.