[Debian-on-mobile-maintainers] [Git][gnome-team/libhandy-1][debian/master] 2 commits: Cherry-pick patch to handle switching to the new dark theme when a "-dark"

Jeremy Bicha (@jbicha) gitlab at salsa.debian.org
Mon Mar 14 13:57:11 GMT 2022



Jeremy Bicha pushed to branch debian/master at GNOME / libhandy-1


Commits:
cda18768 by Jeremy Bicha at 2022-03-14T09:40:33-04:00
Cherry-pick patch to handle switching to the new dark theme when a "-dark"

theme is already in use

Gbp-Dch: Full

- - - - -
3f7db5c1 by Jeremy Bicha at 2022-03-14T09:52:21-04:00
releasing package libhandy-1 version 1.5.91-2

- - - - -


3 changed files:

- debian/changelog
- debian/patches/series
- + debian/patches/style-manager-Don-t-allow-setting-themes-with-dark-in-the.patch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+libhandy-1 (1.5.91-2) experimental; urgency=medium
+
+  * Cherry-pick patch to handle switching to the new dark theme when a "-dark"
+    theme is already in use
+  * Upload to experimental since this change makes more sense with a
+    gnome-control-center that can set the new Dark theme preference
+
+ -- Jeremy Bicha <jeremy.bicha at canonical.com>  Mon, 14 Mar 2022 09:49:07 -0400
+
 libhandy-1 (1.5.91-1) unstable; urgency=medium
 
   * New upstream release


=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
 Disable-atk-during-tests.patch
+style-manager-Don-t-allow-setting-themes-with-dark-in-the.patch


=====================================
debian/patches/style-manager-Don-t-allow-setting-themes-with-dark-in-the.patch
=====================================
@@ -0,0 +1,63 @@
+From: Alexander Mikhaylenko <alexm at gnome.org>
+Date: Mon, 14 Mar 2022 15:21:07 +0400
+Subject: style-manager: Don't allow setting themes with -dark in the name
+
+For example, set Yaru if Yaru-dark is set, so that
+HdyStyleManager:color-scheme keeps working.
+
+https://gitlab.gnome.org/GNOME/libhandy/-/merge_requests/815
+https://gitlab.gnome.org/Teams/Releng/freeze-breaks/-/issues/70
+---
+ src/hdy-style-manager.c | 28 +++++++++++++++-------------
+ 1 file changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/hdy-style-manager.c b/src/hdy-style-manager.c
+index 34f7959..c486563 100644
+--- a/src/hdy-style-manager.c
++++ b/src/hdy-style-manager.c
+@@ -216,14 +216,6 @@ get_system_theme_name (void)
+   return g_value_dup_string (&value);
+ }
+ 
+-static gboolean
+-check_current_theme_exists (gboolean dark)
+-{
+-  g_autofree gchar *theme_name = get_system_theme_name ();
+-
+-  return check_theme_exists (theme_name, dark ? "dark" : NULL);
+-}
+-
+ static void
+ warn_prefer_dark_theme (HdyStyleManager *self)
+ {
+@@ -321,15 +313,25 @@ update_stylesheet (HdyStyleManager *self)
+                 "gtk-application-prefer-dark-theme", self->dark,
+                 NULL);
+ 
+-  if (hdy_settings_get_high_contrast (self->settings))
++  if (hdy_settings_get_high_contrast (self->settings)) {
+     g_object_set (gtk_settings,
+                   "gtk-theme-name",
+                   self->dark ? "HighContrastInverse" : "HighContrast",
+                   NULL);
+-  else if (check_current_theme_exists (self->dark))
+-    gtk_settings_reset_property (gtk_settings, "gtk-theme-name");
+-  else
+-    g_object_set (gtk_settings, "gtk-theme-name", "Adwaita", NULL);
++  } else {
++    g_autofree gchar *theme_name = get_system_theme_name ();
++    gboolean override_theme = FALSE;
++
++    if (g_str_has_suffix (theme_name, "-dark")) {
++      theme_name[strlen (theme_name) - 5] = '\0';
++      override_theme = TRUE;
++    }
++
++    if (!check_theme_exists (theme_name, self->dark ? "dark" : NULL))
++      g_object_set (gtk_settings, "gtk-theme-name", "Adwaita", NULL);
++    else if (override_theme)
++      g_object_set (gtk_settings, "gtk-theme-name", theme_name, NULL);
++  }
+ 
+   g_signal_handlers_unblock_by_func (gtk_settings,
+                                      G_CALLBACK (warn_prefer_dark_theme),



View it on GitLab: https://salsa.debian.org/gnome-team/libhandy-1/-/compare/4d13f8782d3bb81cfa51084bbcb7a36862bc1646...3f7db5c1765230f8c79e72107157942759940afc

-- 
View it on GitLab: https://salsa.debian.org/gnome-team/libhandy-1/-/compare/4d13f8782d3bb81cfa51084bbcb7a36862bc1646...3f7db5c1765230f8c79e72107157942759940afc
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-on-mobile-maintainers/attachments/20220314/f7af086b/attachment-0001.htm>


More information about the Debian-on-mobile-maintainers mailing list