public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Than Ngo <than@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/chromium] epel9-next: fix prefers-color-scheme
Date: Fri, 07 Aug 2026 16:04:47 GMT [thread overview]
Message-ID: <178611868719.1.9905229264670215239.rpms-chromium-f53718b47d89@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/chromium
Branch : epel9-next
Commit : f53718b47d89c98ad0a8396c7a086eefaf74e969
Author : Than Ngo <than@redhat.com>
Date : 2023-02-13T12:44:57+01:00
Stats : +65/-5 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/chromium/c/f53718b47d89c98ad0a8396c7a086eefaf74e969?branch=epel9-next
Log:
fix prefers-color-scheme
---
diff --git a/chromium-110-gtktheme.patch b/chromium-110-gtktheme.patch
new file mode 100644
index 0000000..eb94e04
--- /dev/null
+++ b/chromium-110-gtktheme.patch
@@ -0,0 +1,60 @@
+Update web_instance on GTK when checking for dark mode
+
+Adds some extra code to change the theme in the web instance when on GTK,
+to fix prefers-color-scheme.
+
+Also makes SystemDarkModeSupported return true on Linux,
+since the most modern Linux distributions support it,
+and Linux dark mode code doesn’t detect whether or not it is supported.
+This function seems to only be used in telemetry, so maybe it doesn’t
+need to be changed.
+
+Bug: 998903
+Change-Id: I02a084d9f733b01c8e6ad0f5ca5f1ebcfb16d475
+diff --git a/AUTHORS b/AUTHORS
+index 758d0bf..8c91146 100644
+--- a/AUTHORS
++++ b/AUTHORS
+@@ -735,6 +735,7 @@
+ Leith Bade <leith@leithalweapon.geek.nz>
+ Lei Gao <leigao@huawei.com>
+ Lei Li <lli.kernel.kvm@gmail.com>
++Lena Wildervanck <lena.wildervanck@gmail.com>
+ Lenny Khazan <lenny.khazan@gmail.com>
+ Leo Wolf <jclw@ymail.com>
+ Leon Han <leon.han@intel.com>
+diff --git a/ui/gtk/native_theme_gtk.cc b/ui/gtk/native_theme_gtk.cc
+index a60d6e3..1200a80 100644
+--- a/ui/gtk/native_theme_gtk.cc
++++ b/ui/gtk/native_theme_gtk.cc
+@@ -165,6 +165,14 @@
+ UserHasContrastPreference()
+ ? ui::NativeThemeBase::PreferredContrast::kMore
+ : ui::NativeThemeBase::PreferredContrast::kNoPreference);
++
++ // Update the web instance too to fix prefers-color-theme
++ NativeTheme* web_instance = NativeTheme::GetInstanceForWeb();
++ web_instance->set_use_dark_colors(ShouldUseDarkColors());
++ web_instance->set_preferred_color_scheme(CalculatePreferredColorScheme());
++ web_instance->SetPreferredContrast(CalculatePreferredContrast());
++ web_instance->NotifyOnNativeThemeUpdated();
++
+ native_theme->NotifyOnNativeThemeUpdated();
+ }
+
+diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
+index 835fa36..feec109 100644
+--- a/ui/native_theme/native_theme.cc
++++ b/ui/native_theme/native_theme.cc
+@@ -36,7 +36,11 @@
+ #if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_APPLE)
+ // static
+ bool NativeTheme::SystemDarkModeSupported() {
++#if BUILDFLAG(IS_LINUX)
++ return true;
++#else
+ return false;
++#endif
+ }
+ #endif
+
diff --git a/chromium.spec b/chromium.spec
index cc51298..1592e5f 100644
--- a/chromium.spec
+++ b/chromium.spec
@@ -306,6 +306,9 @@ Patch90: chromium-109-disable-GlobalMediaControlsCastStartStop.patch
# patch for using system opus
Patch91: chromium-108-system-opus.patch
+# fix prefers-color-scheme
+Patch92: chromium-110-gtktheme.patch
+
# From gentoo
Patch98: chromium-94.0.4606.71-InkDropHost-crash.patch
@@ -929,6 +932,8 @@ udev.
%patch91 -p1 -b .system-opus
%endif
+%patch92 -p1 -b .gtk-prefers-color-scheme
+
%patch98 -p1 -b .InkDropHost-crash
# Fedora branded user agent
@@ -1366,8 +1371,6 @@ pushd %{builddir}
# V8 initial snapshots
# https://code.google.com/p/chromium/issues/detail?id=421063
cp -a v8_context_snapshot.bin %{buildroot}%{chromium_path}
- cp -a xdg-mime xdg-settings %{buildroot}%{chromium_path}
- cp -a MEIPreload %{buildroot}%{chromium_path}
# This is ANGLE, not to be confused with the similarly named files under swiftshader/
cp -a libEGL.so libGLESv2.so %{buildroot}%{chromium_path}
@@ -1545,10 +1548,7 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt
%{chromium_path}/%{chromium_browser_channel}.sh
%{chromium_path}/libEGL.so*
%{chromium_path}/libGLESv2.so*
-%{chromium_path}/MEIPreload/
%attr(4755, root, root) %{chromium_path}/chrome-sandbox
-%{chromium_path}/xdg-mime
-%{chromium_path}/xdg-settings
%if %{use_qt}
%{chromium_path}/libqt5_shim.so
%endif
reply other threads:[~2026-08-07 16:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178611868719.1.9905229264670215239.rpms-chromium-f53718b47d89@fedoraproject.org \
--to=than@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox