Repository navigation
windows: TrayIcon SetTooltip + Readd (TaskbarCreated recovery) - #212
Merged
Merged
Conversation
State-aware tray apps (movebit: running/paused + today's totals) currently have to destroy and re-allocate the icon just to relabel the tooltip, and lose the icon entirely the first time Explorer restarts under them — the TaskbarCreated broadcast reaches the host window, but nothing re-registers the icon. SetTooltip issues the NIM_MODIFY/NIF_TIP update; Readd issues the NIM_DELETE + NIM_ADD pair with the stored payload so the host's TaskbarCreated handler is one call. The callback message is now stored so Readd re-registers the same activation contract. Hosts forward TaskbarCreated from their subclass procedure; documented on the class.
# Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found migrating movebit's tray to the first-party
rivet::system::TrayIcon(the movebit host previously hand-rolled Shell_NotifyIcon; see the family tray-capability issue for the full picture).Two gaps make the first-party class unusable for state-aware tray apps today:
SetTooltipissues theNIM_MODIFY/NIF_TIPupdate.TaskbarCreatedbroadcast reaches the host window, but nothing re-registered the icon, so the first Explorer restart under a shipped app silently ate the tray presence.Readdissues theNIM_DELETE+NIM_ADDpair from the stored payload (the callback message is now stored, so the re-registered icon keeps the same activation contract); the host'sTaskbarCreatedhandler is one call. Forwarding is documented on the class — the broadcast reaches the owning HWND, which already must be subclassed to receivecallback_messageanyway.No behavior change for existing callers; constructor/destructor contract unchanged. CHANGELOG entry under Unreleased.
Verified against movebit's host build (Racket 9.0 CS, VS 18, WinUI 3 / Windows App SDK 2.4): icon registers, tooltip relabels per tick, and
Readdon a manually postedTaskbarCreatedrestores the icon.