-
Notifications
You must be signed in to change notification settings - Fork 15k
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
feat: enable dark mode on GTK UIs #38977
Conversation
this also fixes #28838, and #28887 (maybe, haven't tested on Ubuntu 20), tested using https://github.com/electron/electron/tree/main/docs/fiddles/features/dark-mode |
Since Electron/Chromium use GTK3 (EDIT: or at least not libadwaita), the system needs to have So when using Gnome, |
I don't feel strongly either way but we can likely call this a fix and mark it |
A quick test on Ubuntu 22 determines that issue is not resolved by these changes.
That one doesn't repro for me on Ubuntu 22 (haven't tested on Ubuntu 20). I haven't reviewed the changes in this PR, just chiming in after testing it on Ubuntu 22. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "ui/gfx/color_utils.h"
becomes unused with these changes and should be removed in shell/browser/electron_browser_main_parts.cc
.
tested for gnome 42.9 on ubuntu 22.01: 2023-07-14_electron_darkmode_gnome.mp4behavior is the same on fedora 38 with KDE, menubar style follows system UI elements |
i tested this out on ubuntu 20 (gnome 3.36.8) and it seems that there is some inconsistency when switching, even with native apps: 2023-07-14_electron_darkmode_ubuntu20.mp4 |
This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903 and replaces the previous workaround to detect dark mode on GTK. Detect system dark theme preference via xdg settings portal: https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings Closes: electron#38961 Closes: electron#28838 Signed-off-by: Robert Günzler <r@gnzler.io>
that test failure looks like a flake? https://app.circleci.com/pipelines/github/electron/electron/72486/workflows/a9b3d28b-bbf6-42fc-9f50-ee789af823c7/jobs/1567694/tests |
Gentle ping on this :) |
Release Notes Persisted
|
I have automatically backported this PR to "24-x-y", please check out #40008 |
I have automatically backported this PR to "25-x-y", please check out #40009 |
I have automatically backported this PR to "27-x-y", please check out #40010 |
I have automatically backported this PR to "26-x-y", please check out #40011 |
AFAIK the upstream fix has landed in Chromium 114 (Electron 25), so PR for Electron 24 should be rejected. Other PRs, however, should be good to go. Edited: Forget everything I just said because of #40008 (comment) |
feat: port DarkModeManagerLinux This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903 and replaces the previous workaround to detect dark mode on GTK. Detect system dark theme preference via xdg settings portal: https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings Closes: electron#38961 Closes: electron#28838 Signed-off-by: Robert Günzler <r@gnzler.io> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Description of Change
This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903
and replaces the previous workaround to detect dark mode on GTK.
Detect system dark theme preference via xdg settings portal:
https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings
Closes: #38961
Closes #28838
cc @codebytere @ckerr
Checklist
npm test
passesRelease Notes
Notes: Honor XDG dark theme preferences on Linux.