Repository navigation
Set the Windows title-bar icon from the embedded exe resource - #284
Merged
Merged
Conversation
…plate WinUI shows a generic placeholder in the title bar unless the window is handed an icon explicitly, so hosts ran with a foreign default glyph while taskbar and shortcuts showed the real brand icon: the icon was compiled into the exe at resource ID 1 (87cba77) but nothing loaded it. The host template now loads it with LoadIconW and hands it to AppWindow.SetIcon at construction; projects without a windows-icon declaration keep the placeholder.
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.
Problem
Every rivet Windows app runs with WinUI's generic placeholder icon in the title bar, while the taskbar, Alt-Tab and shortcuts show the real brand icon. Found while triaging podlens: the exe correctly carries the project icon (embedded by
rivet-cli/build.rktat resource ID 1 since #283), but nothing ever loaded it into theAppWindow— WinUI only uses the exe icon for the taskbar; the title bar needs an explicitAppWindow.SetIcon.Screenshot before (podlens, title bar at 16px): the slot left of the title shows WinUI's teal default glyph.
Fix
The host template's
MainWindowconstructor now loads the embedded icon and hands it to the window:IconIdoverload, so no icon file needs to ship beside the exe (noresourcesstaging needed).windows-icondeclaration keep the placeholder.MainWindow(de7149e) as the first existing product.Existing products (taskly, payback, movebit, …) carry their own generated
MainWindow.xaml.cppand need the same lines; the template fix covers all newly scaffolded hosts.Testing
raco test rivet/tests/(no Racket-side change expected)