Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(windows): tray icon gets blurry after changing dpi #145

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

Legend-Master
Copy link
Contributor

@Legend-Master Legend-Master commented Apr 26, 2024

Fixes tauri-apps/tauri#9335

Re-add tray icon on TaskbarCreated message

This is what Electron does

https://github.com/electron/electron/blob/b41da150caa363d06f522427c87bd989464c9edd/shell/browser/ui/win/notify_icon_host.cc#L244-L251
https://github.com/electron/electron/blob/b41da150caa363d06f522427c87bd989464c9edd/shell/browser/ui/win/notify_icon.cc#L114-L131

I don't quite understand why the Power Toys' implementation doesn't use the NIM_DELETE while still works

https://github.com/microsoft/PowerToys/blob/28ba2bd301f47250e53876d21d240ba5434bb7af/src/runner/tray_icon.cpp#L253-L257

The document didn't mention deleting the existing icon as well

When the taskbar is created, it registers a message with the TaskbarCreated string and then broadcasts this message to all top-level windows. When your taskbar application receives this message, it should assume that any taskbar icons it added have been removed and add them again.
https://learn.microsoft.com/en-us/windows/win32/shell/taskbar#taskbar-creation-notification

@Legend-Master Legend-Master changed the title fix(windows) tray icon gets blurry after changing dpi fix(windows): tray icon gets blurry after changing dpi Apr 27, 2024
@amrbashir amrbashir merged commit a1cd50e into tauri-apps:dev Apr 29, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] System tray icon gets blurry on Windows after changing system UI scaling
2 participants