-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
tauri: feat: add taskbar "unread" badge on Windows #4935
base: main
Are you sure you want to change the base?
Conversation
As I said in the comments, Tauri's `setBadgeCount` is not supported on Windows. This will not show the count, but only the fact that there is a new message. This is not ideal, but it's better than nothing.
I'd rather have us contribute to tauri to fix that it is not supported... But this already is an improvement. |
window.setOverlayIcon?.( | ||
value === 0 ? undefined : 'images/tray/unread-badge.png' | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would make sense to only run this on windows. you could pass that info to here via RuntimeInfo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also prefer that. But this function is Windows-only as of now, So I suggest to keep it as is until the badge counter is supported by Tauri, or until we are otherwise forced to do it.
Yes, I considered that. I think we should implement the proper counter in Tauri though, and not just a binary badge. |
I don't think so, it is a windows api: https://learn.microsoft.com/en-us/uwp/api/windows.ui.notifications.badgenotification?view=winrt-26100#definition not sure if this crate would be used or a different one that is smaller: https://microsoft.github.io/windows-docs-rs/doc/windows/UI/Notifications/struct.BadgeNotification.html - not sure what tauri uses to access windows api, I would try to work with what tauri uses first. Though for older windows, the overlay icon method might still make sense, though I don't think we will spend resources to port to windows 7. |
Hmmm. I assumed that it's not supported because Windows only exposes the "overlay icon" thing. |
it is mostly about what tauri supports of on the platforms, real badges are just not implemented yet is seems. |
As I said in the comments, Tauri's
setBadgeCount
is not supportedon Windows.
This will not show the count, but only the fact
that there is a new message.
This is not ideal, but it's better than nothing.
TODO: