Dark Mode under Windows
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 68
- Forks
- 82
- PR merge metrics
- No merged PRs in 30d
Description
The OS-drawn controls aren't working properly when DrRacket is in dark mode.
This issue was created by culling the specific comments from https://github.com/racket/drracket/issues/235.
@jcolivo wrote
Hello Racket Team,
I appreciate all the hard work on trying to improve the dark mode in DrRacket. Thank you.Just hoping that you won't forget us Windows users. ;-)
My issues are as pointed out in this thread: https://groups.google.com/forum/#!topic/racket-dev/xYjE9JCe9u0If there is anything I can do to help (I'm not a programmer, but can certainly help with testing), please let me know.
Have a wonderful weekend!
@alex-hhh wrote
The registry key AppsUseLightTheme in
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize,
will be 1 or missing if applications use the "light" theme and will be 0 if
the applications should use a dark theme.I verified that AppsUseLightTheme changes to 0 if I select "dark" mode in
my preferences on my Windows 10 machine. The key is missing if "Dark" mode
was never selected on a machine.white-on-black-panel-scheme? could just look for this key on Windows?
@mflatt wrote:
More ideas for dark mode on Windows based on various undocumented flags and functions: mflatt/gui@fd38e76
Last time I looked at this, I concluded that system Win32 control classes like buttons or checkboxes (I forget which, but I think it was buttons) don't support dark mode.
@jcolivo wrote
I found the Windows Registry Key as @default-kramer mentioned above referencing the StackOverflow thread:
https://stackoverflow.com/questions/51334674/how-to-detect-windows-10-light-dark-mode-in-win32-applicationIf you want the "Choose your default app mode" setting, I'm pretty sure that I can find it in the Windows registry somewhere. (In fact, this looks like it: https://stackoverflow.com/questions/51334674/how-to-detect-windows-10-light-dark-mode-in-win32-application) I can try to make a PR for mrlib if this is the desired behavior. I don't have any older versions of Windows handy, so it will likely support Win10 only.
On my system (64 bit Windows 10, latest version), I verified the location of the registry key:
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\PersonalizeThis is a screenshot of the key when light theme is chosen. Notice the ApsUseLightTheme value set at 0x00000001 (1)
This is a screenshot of the key when dark theme is chosen. Notice the ApsUseLightTheme value now set at 0x00000000 (0)
Would this feature require Racket code to look for this specific registry key value, or would the code be written at a lower level?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Windows GUI code around the mentioned white-on-black-panel-scheme? entry point and checking how OS-drawn controls are handled. Compare its behavior with the AppsUseLightTheme registry value at the documented Windows path; done means Windows controls render appropriately when DrRacket uses dark mode.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100

