New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wip] Windows: system theme #143
Conversation
Hi! Thanks again for taking time and effort to tackle this. This is an important issue we’d love to see it merged in JWM as soon as possible. I know your branch is still WIP, but @EgorOrachyov and I took a quick look and have a bit of feedback to share so far. I hope you don’t mind.
Thanks again and glad to see you among contributors! |
@tonsky
I suppose you mean ntdll.dll here; "dynamic version check (user32.dll)". I separated version check from set theme function respectively and now use only uxtheme.dll part. Should I remove version check part or keep it?
I agree with you. It would be better. I checked Electron implementation. I'm going to expose isHighContrast function and isInverted function. |
- separate version check from function to check dark theme support - simplify version check since JWM currently supports Windows 10+ - format code style
5e8dbce
to
7f70a45
Compare
7f70a45
to
8c47022
Compare
@tonsky Perhaps I may miss something, but I think |
Sure, we can come back to it later |
From what I see on Electron, not all of these properties are supported on all platforms. It might be that Windows doesn’t even have inverted mode (does it?) |
As far as I konw, Windows does have invert color scheme(ctrl+alt+I), but I could not find a way to programatically detect/control it.(There is InvertRect api, but it does not suit for use case. ) I also have a quick look at chromium implementation. https://chromium.googlesource.com/chromium/src/+/refs/heads/main/ui/native_theme/native_theme_win.cc |
494b588
to
ffbeba0
Compare
I’m not sure how is Github supposed to communicate when this is ready to review, so please let me know! So far, I took a quick look and have a few questions:
|
@tonsky
I suppose the case where user wants to get Theme, contrast and other appearance properties at once rather than calling each getter (e.g. when initializing an application window). I decide to have theme data class according to your advice and I prefer having Theme as enum rather to having theme as bool flag like
I assumed such case as user wants to specify whether to use theme inherited from system or to override theme of a respective window by specifying theme. |
@tonsky I think this PR becomes a bit messy, so I will separate changes in other PRs. |
70c2fcc
to
7c84338
Compare
b4a6c73
to
bada613
Compare
Add functions to get window theme and switch light/dark mode.
I implemented it by referring to winit and this.
See also: