-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
[Bug][Regression][32-33]: Dark theme is not applied to Dev Tools #43367
Comments
Hello @AviVahl. Thanks for reporting this and helping to make Electron better! Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use. Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests. Now adding the
blocked/need-repro
|
https://github.com/wixplosives/example-electron-app
|
This issue also occurs on the macOS platform. My macOS version: Sonoma 14.6.1 (23G93) |
Also happens on both Windows 10 and 11 (so not a platform-specific issue it seems) |
Happening on macOS sonoma electron 32.0.1 |
From my experience (above duplicate)... Reproducible in fiddle as well. versions
|
still happens with 32.0.2 |
I updated from 30 to 32 and now have this issue.. even though dark mode is set .. i have to toggle to light and back to dark so it is applied as the op already showed Edit created a quick workaround with this train of thought while they fix this 😎 evil bug. Use the devtools-opened event to toggle back and forth import {app, BrowserWindow ,nativeTheme} from 'electron';
function toggleNativeTheme() {
// First, set the theme to 'light'
nativeTheme.themeSource = 'light';
// After a short delay, set it to 'dark'
setTimeout(() => {
nativeTheme.themeSource = 'dark';
}, 100); // 100ms delay; adjust if necessary
}
browserWindow?.webContents.openDevTools();
browserWindow.webContents.on('devtools-opened', () => {
toggleNativeTheme();
}); |
Already checked which commit introduced the issue. Will submit a PR in further at the right time. |
Hope this gets fixed, annoying to have to manually set it to dark every time I open devtools. |
still happens with |
Thank you for the tip :) |
Thinks your code 👋🏼, But it's better to window.webContents.on('devtools-opened', () => {})
window.webContents.openDevTools(); |
Can confirm this bug in v32.1.2. |
PR has been submitted and will be merged soon. |
Issue still occurs with electron 33.0.0 |
My eyes are burning. Please resolve this issue ASAP. 🥹 |
Preflight Checklist
Electron Version
32.0.0, 32.0.1, 32.0.2, 33.0.2, 34.0.0-alpha.3
What operating system(s) are you using?
Other Linux
Operating System Version
Arch Linux with GNOME
What arch are you using?
x64
Last Known Working Electron version
31.4.0
Expected Behavior
When opening dev tools, they should be dark themed, assuming Settings -> Theme is set to "Dark" or "Browser preference" (with the system being dark)
Actual Behavior
Dev tools open in light theme, no matter what which setting is set.
Testcase Gist URL
No response
Additional Information
Setting the theme to Light and then back to Dark causes it to actually apply. That is until you close and re-open dev tools.
Screencast.from.2024-08-20.10-57-52.webm
The text was updated successfully, but these errors were encountered: