Skip to content

Commit

Permalink
fix(tray): case sensitive comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
eythaann committed Jan 30, 2025
1 parent 44ce498 commit e5acb97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/background/modules/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,12 @@ impl ServiceClient {
let mut action_path = windows_core::BSTR::new();
action.Path(&mut action_path)?;

let action_path = PathBuf::from(action_path.to_string());
let service_path = std::env::current_exe()?.with_file_name("slu-service.exe");
match action_path == service_path {
let service_path = std::env::current_exe()?
.with_file_name("slu-service.exe")
.to_string_lossy()
.to_lowercase();

match action_path.to_string().to_lowercase() == service_path {
true => {
task.Run(None)?;
Ok(())
Expand Down
3 changes: 2 additions & 1 deletion src/background/modules/tray/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,9 @@ impl TrayIconManager {
};
item.is_running = unsafe { Shell_NotifyIconGetRect(&identifier).is_ok() };
} else if let Some(uid) = &item.icon_uid {
let str_item_exe_path = item.executable_path.to_string_lossy().to_lowercase();
item.is_running = windows.iter().any(|w| match w.process().program_path() {
Ok(path) if path == item.executable_path => {
Ok(path) if path.to_string_lossy().to_lowercase() == str_item_exe_path => {
let identifier = NOTIFYICONIDENTIFIER {
cbSize: std::mem::size_of::<NOTIFYICONIDENTIFIER>() as u32,
hWnd: w.hwnd(),
Expand Down

0 comments on commit e5acb97

Please sign in to comment.