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
This commit is contained in:
parent
c5aa834b6a
commit
00091a2acb
@ -129,13 +129,19 @@ on_stage_destroy (ClutterStage *stage)
|
|||||||
g_object_unref (context);
|
g_object_unref (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
emit_changed (StThemeContext *context)
|
||||||
|
{
|
||||||
|
g_signal_emit (context, signals[CHANGED], 0);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
st_theme_context_changed (StThemeContext *context)
|
st_theme_context_changed (StThemeContext *context)
|
||||||
{
|
{
|
||||||
StThemeNode *old_root = context->root_node;
|
StThemeNode *old_root = context->root_node;
|
||||||
context->root_node = NULL;
|
context->root_node = NULL;
|
||||||
|
|
||||||
g_signal_emit (context, signals[CHANGED], 0);
|
emit_changed (context);
|
||||||
|
|
||||||
if (old_root)
|
if (old_root)
|
||||||
g_object_unref (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;
|
/* 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
|
* 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
|
* icon_name => icon lookup, faking a theme context change is a good way
|
||||||
* to force users such as StIcon to look up icons again */
|
* to force users such as StIcon to look up icons again. Don't bother recreating
|
||||||
st_theme_context_changed (context);
|
* the root node, though. */
|
||||||
|
emit_changed (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user