Repository navigation
fix(tray): the menu on Windows follows dark mode - #259
Merged
Merged
Conversation
7schmiede
force-pushed
the
fix/tray-dark-menu
branch
from
October 23, 2026 21:59
442c5d5 to
18b414d
Compare
Win32 popup menus are light unless the app opts in, and Windows has no documented API for it: uxtheme.dll's ordinals 135 (SetPreferredAppMode, AllowDark), 133 (AllowDarkModeForWindow) and 136 (FlushMenuThemes), as Explorer and other programs with dark menus use them. Called at start and on WM_SETTINGCHANGE "ImmersiveColorSet"; where one is missing (before 1809) the menu stays light. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7schmiede
force-pushed
the
fix/tray-dark-menu
branch
from
October 23, 2026 22:08
18b414d to
653c31c
Compare
Merged
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 tray's popup menu on Windows was light with the system's apps set to dark (seen on 0.21.0, Windows 11).
Win32 menus are light unless the app opts in, and there is no documented API for it.
uxtheme.dllexports by ordinal only:SetPreferredAppMode(AllowDark)(AllowDarkModeForApp(true)on 1809, same argument),AllowDarkModeForWindow(hwnd, true)on the tray's hidden window, which owns the menu,FlushMenuThemes.dark_menuscalls them at start and again onWM_SETTINGCHANGE"ImmersiveColorSet", so a change of mode while the tray runs is followed. Where an ordinal is missing (before Windows 10 1809) nothing is called and the menu stays light. Light mode stays light:AllowDarkfollows the system, it does not force dark.Checked:
cargo clippy -p devstack-desktop --all-targets --target x86_64-pc-windows-msvc,cargo fmt.Not checked: run on Windows (dark and light mode, a switch while it runs). Needed before 0.22.0.
🤖 Generated with Claude Code