[gnome-shell] St: recompute all theme nodes when the icon theme changes
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] St: recompute all theme nodes when the icon theme changes
- Date: Thu, 6 Dec 2012 22:42:22 +0000 (UTC)
commit 208121646caba0b23288414385a9c80b64417497
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Fri Nov 30 15:48:37 2012 +0100
St: recompute all theme nodes when the icon theme changes
StWidget considers "same theme node" as an indication that the style
did not change, and skips emitting style-changed in that case. This
means that icon theme changes are not picked up by StIcon.
https://bugzilla.gnome.org/show_bug.cgi?id=689353
src/st/st-theme-context.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/st/st-theme-context.c b/src/st/st-theme-context.c
index 5891cf7..399a858 100644
--- a/src/st/st-theme-context.c
+++ b/src/st/st-theme-context.c
@@ -143,13 +143,6 @@ on_stage_destroy (ClutterStage *stage)
g_object_unref (context);
}
-static gboolean
-emit_changed (StThemeContext *context)
-{
- g_signal_emit (context, signals[CHANGED], 0);
- return FALSE;
-}
-
static void
st_theme_context_changed (StThemeContext *context)
{
@@ -157,12 +150,19 @@ st_theme_context_changed (StThemeContext *context)
context->root_node = NULL;
g_hash_table_remove_all (context->nodes);
- emit_changed (context);
+ g_signal_emit (context, signals[CHANGED], 0);
if (old_root)
g_object_unref (old_root);
}
+static gboolean
+changed_idle (gpointer userdata)
+{
+ st_theme_context_changed (userdata);
+ return FALSE;
+}
+
static void
on_icon_theme_changed (StTextureCache *cache,
StThemeContext *context)
@@ -170,9 +170,9 @@ on_icon_theme_changed (StTextureCache *cache,
/* Note that an icon theme change isn't really a change of the StThemeContext;
* the style information has changed. But since the style factors into the
* icon_name => icon lookup, faking a theme context change is a good way
- * to force users such as StIcon to look up icons again. Don't bother recreating
- * the root node, though. */
- g_idle_add ((GSourceFunc) emit_changed, context);
+ * to force users such as StIcon to look up icons again.
+ */
+ g_idle_add ((GSourceFunc) changed_idle, context);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]