Repository navigation
Tray: icons in the right-click menu - #844
Merged
Merged
Conversation
Open, Start, Stop, Refresh and Exit each show a pictogram, the UI's own for the same thing (Start.svg, Stop.svg, Refresh.svg, the logo for Open) plus an Exit drawn after lbm-ui's Icon::Power, the UI having none. Linux: DBusMenu's icon-name with the Icon Naming Spec names (media-playback-start, media-playback-stop, view-refresh, application-exit), so the entries follow KDE's light or dark theme; the UI's pictograms are black where they mean "the foreground" and would vanish in a dark menu. Open carries the logo as icon-data (PNG), readable on both. Windows: an item bitmap per entry (MENUITEMINFO.hbmpItem), a 32-bit DIB premultiplied by its alpha, at the small-icon size of the moment (SM_CXSMICON), made when the menu opens and freed once it is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mgth
commented
Nov 26, 2026
mgth
left a comment
Owner
Author
There was a problem hiding this comment.
Les 23 tests ciblés des icônes et du menu passent sous Linux. Il reste un cas Windows à corriger pour les configurations où les écrans ont des facteurs d’échelle différents.
The agent is per-monitor DPI aware, and GetSystemMetrics(SM_CXSMICON) answers for the primary screen: a menu opened on a 200 % screen beside a 100 % primary got 16 px bitmaps in 32 px slots. The size now comes from GetSystemMetricsForDpi with the DPI of the monitor under the cursor, where TrackPopupMenu opens the menu, read before the bitmaps are made (review on #844). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The maintainer asked: « ajouter des icônes au menu clique droit dans la zone de notif ».
What each entry shows
icon-data: the logo (lbm_logo.svg, 32 px PNG)icon-namemedia-playback-startStart.svgicon-namemedia-playback-stopStop.svgicon-nameview-refreshRefresh.svgicon-nameapplication-exiticons/menu/Exit.svg, drawn after lbm-ui'sIcon::Power(the UI had no exit pictogram)MENUITEMINFOW.hbmpItem, a 32-bit top-down DIB with the colours premultiplied by alpha (whatAlphaBlendreads in a themed menu), at theSM_CXSMICONsize of the moment (PNGs at 16/20/24/32/40/48 px, the next size up). The bitmaps are made when the menu opens and freed afterDestroyMenu: a menu does not own its items' bitmaps, and the DPI may have changed since the last opening. The menu is the light Win32 one (the agent does not opt into dark menus), hence the black pictograms there.icons/render.sh(extended), like the tray icons.Tests
icons: every menu icon decoded at every size, the colours match the UI's pictograms, the theme names table,at_least(size choice),premultiplied_bgra(byte order, rounding, never a colour above its alpha).tray: one icon per entry; the Linux menu carries the theme names and the logo's PNG.tray::windows: every menu icon makes a DIB and it is freed (runs in the Windows CI job).cargo clippy --workspace --all-targets -D warningsclean on Linux andx86_64-pc-windows-gnu;cargo fmt --checkclean.Seen
--fake-hook, its ownXDG_RUNTIME_DIR, config and data) published the menu.GetLayoutover D-Bus shows the names and the PNG, and a real right-click displayed the five icons: Breeze's icons in white, the logo in colour.C:\LittleBigMouse\v6; the menu opened by the message a right-click on the icon sends (WM_APP+1,WM_RBUTTONUP) and captured: the five pictograms on the light menu, edges blended, no black boxes. The menu then closed onWM_CANCELMODE, nothing chosen.🤖 Generated with Claude Code