public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alexandre Restovtsev" <tetromino@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gnome:master commit in: x11-libs/gtk+/files/, x11-libs/gtk+/
Date: Thu, 15 Mar 2012 15:55:35 +0000 (UTC)	[thread overview]
Message-ID: <1331826891.55a9cc0a2099135b112bb3a0adaeaf581d60ea6c.tetromino@gentoo> (raw)

commit:     55a9cc0a2099135b112bb3a0adaeaf581d60ea6c
Author:     Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 15 15:50:56 2012 +0000
Commit:     Alexandre Restovtsev <tetromino <AT> gmail <DOT> com>
CommitDate: Thu Mar 15 15:54:51 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=55a9cc0a

x11-libs/gtk+: use theme in /etc/gtk-3.0/settings.ini as fallback

Fall back to theme in /etc/gtk-3.0/settings.ini if the theme specified
by gnome-settings-daemon does not support gtk3 (provides a better gtk3
experience for gnome2 users).

---
 .../gtk+/files/gtk+-3.3.18-fallback-theme.patch    |   81 ++++++++++++++++++++
 .../{gtk+-3.3.18.ebuild => gtk+-3.3.18-r1.ebuild}  |    3 +
 2 files changed, 84 insertions(+), 0 deletions(-)

diff --git a/x11-libs/gtk+/files/gtk+-3.3.18-fallback-theme.patch b/x11-libs/gtk+/files/gtk+-3.3.18-fallback-theme.patch
new file mode 100644
index 0000000..7f5d0a1
--- /dev/null
+++ b/x11-libs/gtk+/files/gtk+-3.3.18-fallback-theme.patch
@@ -0,0 +1,81 @@
+From 1a3f790830c2db70eb3369e684c3cd8ac3b8051b Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Wed, 14 Mar 2012 23:08:53 -0400
+Subject: [PATCH] settings: fall back to settings.ini gtk theme if requested
+ theme fails
+
+If a gtk3 application is run in gnome2 and the settings daemon uses
+xsettings to request a gtk2 theme with no gtk3 version (which is the
+case by default), then instead of failing to load any theme, we should
+attempt to fall back to the theme specified in settings.ini files.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=654108
+---
+ gtk/gtksettings.c |   23 +++++++++++++++++++++++
+ 1 files changed, 23 insertions(+), 0 deletions(-)
+
+diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
+index 2e17430..354ba34 100644
+--- a/gtk/gtksettings.c
++++ b/gtk/gtksettings.c
+@@ -115,6 +115,7 @@ struct _GtkSettingsPrivate
+   GtkCssProvider *theme_provider;
+   GtkCssProvider *key_theme_provider;
+   GtkStyleProperties *style;
++  gchar *fallback_gtk_theme_name;
+ };
+ 
+ typedef enum
+@@ -1528,6 +1529,8 @@ gtk_settings_finalize (GObject *object)
+   if (priv->style)
+     g_object_unref (priv->style);
+ 
++  g_free (priv->fallback_gtk_theme_name);
++
+   G_OBJECT_CLASS (gtk_settings_parent_class)->finalize (object);
+ }
+ 
+@@ -1889,6 +1892,12 @@ apply_queued_setting (GtkSettings             *settings,
+       if (pspec->param_id == PROP_COLOR_SCHEME)
+         merge_color_scheme (settings, &tmp_value, qvalue->source);
+ 
++      if (!g_strcmp0 (pspec->name, "gtk-theme-name") && qvalue->source == GTK_SETTINGS_SOURCE_DEFAULT)
++        {
++          g_free (priv->fallback_gtk_theme_name);
++          priv->fallback_gtk_theme_name = g_value_dup_string (&tmp_value);
++        }
++
+       if (priv->property_values[pspec->param_id - 1].source <= qvalue->source)
+         {
+           g_value_copy (&tmp_value, &priv->property_values[pspec->param_id - 1].value);
+@@ -2594,6 +2603,10 @@ _gtk_settings_reset_rc_values (GtkSettings *settings)
+         }
+       i++;
+     }
++
++  g_free (priv->fallback_gtk_theme_name);
++  priv->fallback_gtk_theme_name = NULL;
++
+   g_object_thaw_notify (G_OBJECT (settings));
+   g_free (pspecs);
+ }
+@@ -2881,6 +2894,16 @@ settings_update_theme (GtkSettings *settings)
+ 
+       if (!provider)
+         provider = gtk_css_provider_get_named (theme_name, NULL);
++
++      /* If we failed, fall back to the theme from settings.ini */
++      if (!provider && priv->fallback_gtk_theme_name && *priv->fallback_gtk_theme_name
++          && g_strcmp0 (theme_name, priv->fallback_gtk_theme_name))
++        {
++          provider = gtk_css_provider_get_named (priv->fallback_gtk_theme_name, NULL);
++
++          if (!provider)
++            provider = gtk_css_provider_get_named (priv->fallback_gtk_theme_name, NULL);
++        }
+     }
+ 
+   /* If we didn't find the named theme, fall back */
+-- 
+1.7.8.5
+

diff --git a/x11-libs/gtk+/gtk+-3.3.18.ebuild b/x11-libs/gtk+/gtk+-3.3.18-r1.ebuild
similarity index 98%
rename from x11-libs/gtk+/gtk+-3.3.18.ebuild
rename to x11-libs/gtk+/gtk+-3.3.18-r1.ebuild
index 4d353a9..592807e 100644
--- a/x11-libs/gtk+/gtk+-3.3.18.ebuild
+++ b/x11-libs/gtk+/gtk+-3.3.18-r1.ebuild
@@ -96,6 +96,9 @@ src_prepare() {
 	replace-flags -O3 -O2
 	strip-flags
 
+	# https://bugzilla.gnome.org/show_bug.cgi?id=65410
+	epatch "${FILESDIR}/${PN}-3.3.18-fallback-theme.patch"
+
 	# Non-working test in gentoo's env
 	sed 's:\(g_test_add_func ("/ui-tests/keys-events.*\):/*\1*/:g' \
 		-i gtk/tests/testing.c || die "sed 1 failed"



             reply	other threads:[~2012-03-15 15:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-15 15:55 Alexandre Restovtsev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-01-18 21:07 [gentoo-commits] proj/gnome:master commit in: x11-libs/gtk+/files/, x11-libs/gtk+/ Mart Raudsepp
2014-11-30 15:52 Remi Cardona
2014-04-20 18:17 Gilles Dartiguelongue
2012-08-10  5:31 Priit Laes
2012-08-05 13:34 Priit Laes
2012-02-26 21:19 Alexandre Restovtsev
2011-10-17 19:10 Alexandre Restovtsev
2011-03-29  8:35 Nirbheek Chauhan
2011-03-09 11:34 Nirbheek Chauhan
2011-02-25  9:39 Priit Laes

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=1331826891.55a9cc0a2099135b112bb3a0adaeaf581d60ea6c.tetromino@gentoo \
    --to=tetromino@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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