From c532ba484cb4c0a7a7f5f9069aac1ee31251bc29 Mon Sep 17 00:00:00 2001 From: eythaann Date: Fri, 28 Jun 2024 16:18:13 -0500 Subject: [PATCH] Fix empty tray icons --- changelog.md | 1 + src/background/modules/tray/application.rs | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/changelog.md b/changelog.md index cfc8e52c..925a4d56 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ ### fix - no updating colors correctly on change light or dark mode on windows settings. - window manager enabled by default for new users. +- showing tray icons with empty name. ## [1.7.7] ### fix diff --git a/src/background/modules/tray/application.rs b/src/background/modules/tray/application.rs index e030d8b5..96ca3f61 100644 --- a/src/background/modules/tray/application.rs +++ b/src/background/modules/tray/application.rs @@ -105,12 +105,6 @@ pub fn try_force_tray_overflow_creation() -> Result<()> { }) } -/* -FOR TASKBAR ICONS: -let rebar_hwnd = FindWindowExA(tray_hwnd, HWND(0), s!("ReBarWindow32"), None); -let task_hwnd = FindWindowExA(rebar_hwnd, HWND(0), s!("MSTaskSwWClass"), None); -let task_list_hwnd = FindWindowExA(task_hwnd, HWND(0), s!("MSTaskListWClass"), None); */ - pub fn get_tray_icons() -> Result> { let tray_from_registry = TrayIcon::enum_from_registry().unwrap_or_default(); @@ -130,9 +124,8 @@ pub fn get_tray_icons() -> Result> { let is_win10 = is_windows_10(); for element in children { - if is_win10 || element.CurrentAutomationId()? == "NotifyItemIcon" { - let name = element.CurrentName()?.to_string(); - + let name = element.CurrentName()?.to_string(); + if name.len() > 0 && (is_win10 || element.CurrentAutomationId()? == "NotifyItemIcon") { let registry = tray_from_registry.iter().find(|t| { let trimmed = name.trim(); t.initial_tooltip == trimmed