-
Notifications
You must be signed in to change notification settings - Fork 15.7k
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
[Windows] Title bar does not respect dark mode #23479
Comments
This is only doable using undocumented APIs for win32 applications |
I have a WIP for this and will push it to a public branch RSN. Hoping to have this ready by the end of the week. |
I have updated the patch based on review feedback. In this week's Releases Workgroup meeting, I'll propose its inclusion. The point of contention in review is that a fair amount of private API is necessary to make this work. |
An agreement has been reached about how to handle use of nonpublic APIs -- this PR will be merged behind a compile-time feature flag. |
After a few more revision requests, the PR to honor |
This has been merged into Electron 10, 11, and |
Any chance this will be enabled in pre-built versions so I can actually use this in my projects? I do not like using a custom title bar for Windows only. |
Maybe this issue should be reopened as it is still not available in the production builds @ckerr |
@ckerr I tried the flag mentioned here on electron v11.4.4, looks like the issue is partially solved. The right OS theme is applied to the browserWindow title bar at the time when browserWindow is created during the app launch, but the theme change is not getting reflected in the title bar when we switch between the OS theme while the app is already launched. I have tried setting |
@ckerr I haven't spent a lot of time looking at your initial PR, but it seems that the code is only checking the system theme and applying the theme mode on windows creations, i.e.: if (message == WM_NCCREATE) {
...
} Based on what @twitharshil , the |
Im confused because It is closed but not fixed in the production build. |
@bmsuseluda Been tracking this for a while and we kinda gave up on this being fixed quickly. I suspect it doesn't help that, at least on the Windows side, the OS-level handling of dark mode seemed a bit shaky to start with. I also remember some old thread saying that there were also changes needed on the Chromium side before this could work in Electron. I agree this should get re-opened if it's not being tracked elsewhere. |
Is there any update to this issue? It seems like this issue should be reopened. |
@bradmanAWS Sounds like there has been some movement, see: #33624 |
Preflight Checklist
Issue Details
When setting nativeTheme.themeSource to 'dark' (or 'system' and setting the system theme to 'dark'), the title bar on Windows remains light. On macOS, the title bar accurately reflects the setting.
npm ./node_modules/.bin/electron --version
: 6.9.0"electron": "^8.2.5",
Expected Behavior
(This works as expected on macOS)
Actual Behavior
To Reproduce
Screenshots
Command Prompt:
File Explorer:
Title Bar in Electron with
nativeTheme.themeSource = 'dark'
The text was updated successfully, but these errors were encountered: