dremin / RetroBar

Classic Windows 95, 98, Me, 2000, XP, Vista taskbar for modern versions of Windows
Apache License 2.0
2.75k stars 259 forks source link

System tray icons may become shuffled #743

Open igprya opened 8 months ago

igprya commented 8 months ago

Hi there! 🙂 This is mostly a nitpick, posting it here just to hopefully save a fellow perfectionist a few minutes of figuring this out.

Side note, I'm absolutely in love with RetroBar, never thought that such a minor thing can improve UX to such a great extent. 😎 Really appreciate the work that was put into this, an awesome idea and a great implementation. 👍  

Current behavior

System icons (battery, sound and network) may appear at an arbitrary position within the tray panel. The position is implicitly dependent on the order in which the user chooses to customize hidden/shown icons. The position persists even if user disables "Collapse notification area icons" option afterwards.

image

Expected behavior

System icons always appear in front of the system clock, unless hidden.

image

Workaround

  1. Go to "Customize Notifications" dialog,
  2. Under "Behavior" column select "Hide when inactive" for all icons,
  3. Under "Behavior" column select "Always show" for required icons in the inverse order you want them to be shown, as the tray shows icons left-to-right. This means that whichever icon you select first will be the left-most from the clock, and an icon that was selected last will appear right next to the clock. For example, on the screenshot above the selection order was (1) Wireguard, (2) Telegram, (2) Network, (3) Volume, (4) Power.

Probable cause

Whenever a user pins or unpins an icon, WPF triggers the binding to IsPinned property of an icon, which in turn calls ManagedShell.WindowsTray.NotifyIcon.Pin with no position argument, causing an icon in question to be moved to the end of the list of pinned icons.

Possible solutions

igprya commented 8 months ago

Related to #441