Commit 25d2dbf8 authored by Marco Trevisan's avatar Marco Trevisan 🎺

st-widget: Use Quark data to check initialized theme

GNOME/gnome-shell!535
parent c7692bb3
Pipeline #80227 passed with stages
in 7 minutes and 34 seconds
......@@ -546,11 +546,16 @@ on_theme_context_changed (StThemeContext *context,
static StThemeNode *
get_root_theme_node (ClutterStage *stage)
{
static GQuark st_theme_initialized = 0;
StThemeContext *context = st_theme_context_get_for_stage (stage);
if (!g_object_get_data (G_OBJECT (context), "st-theme-initialized"))
if (G_UNLIKELY (st_theme_initialized == 0))
st_theme_initialized = g_quark_from_static_string ("st-theme-initialized");
if (!g_object_get_qdata (G_OBJECT (context), st_theme_initialized))
{
g_object_set_data (G_OBJECT (context), "st-theme-initialized", GUINT_TO_POINTER (1));
g_object_set_qdata (G_OBJECT (context), st_theme_initialized,
GUINT_TO_POINTER (1));
g_signal_connect (G_OBJECT (context), "changed",
G_CALLBACK (on_theme_context_changed), stage);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment