[gnome-shell] st-theme-context: Make icon theme changes a bit more efficient
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] st-theme-context: Make icon theme changes a bit more efficient
- Date: Thu, 5 Apr 2012 03:26:13 +0000 (UTC)
commit 00091a2acb40a3237b9abf90fbc42ffd010c7780
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Apr 4 16:13:07 2012 -0400
st-theme-context: Make icon theme changes a bit more efficient
There's no need to destroy and recreate the root node for an icon theme
change. Just emit the CHANGED signal.
https://bugzilla.gnome.org/show_bug.cgi?id=673512
src/st/st-theme-context.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/st/st-theme-context.c b/src/st/st-theme-context.c
index 6fe5fb7..0e96cdb 100644
--- a/src/st/st-theme-context.c
+++ b/src/st/st-theme-context.c
@@ -130,12 +130,18 @@ on_stage_destroy (ClutterStage *stage)
}
static void
+emit_changed (StThemeContext *context)
+{
+ g_signal_emit (context, signals[CHANGED], 0);
+}
+
+static void
st_theme_context_changed (StThemeContext *context)
{
StThemeNode *old_root = context->root_node;
context->root_node = NULL;
- g_signal_emit (context, signals[CHANGED], 0);
+ emit_changed (context);
if (old_root)
g_object_unref (old_root);
@@ -148,8 +154,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 */
- st_theme_context_changed (context);
+ * to force users such as StIcon to look up icons again. Don't bother recreating
+ * the root node, though. */
+ emit_changed (context);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]