[gnome-shell] st-theme-context: Punt icon theme changes to an idle



commit 0a7968a2e55cb9c7063d65663d5bff504724f7a8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Apr 4 16:22:42 2012 -0400

    st-theme-context: Punt icon theme changes to an idle
    
    Icon theme change signals aren't noticed immediately, they're usually
    noticed when trying to load an icon. Since icon theme changes cause a
    style change, and most icon widgets try to re-load their texture during
    a style change, this means that we get a stack like this:
    
      st_texture_cache_load_icon
      gtk_icon_theme_lookup_icon
      gtk_icon_theme_changed
      st_widget_style_changed
      st_texture_cache_load_icon
    
    Rather than making every place that uses StTextureCache re-entrant,
    punt the notifying of icon theme changes to an idle handler instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673512

 src/st/st-theme-context.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/st/st-theme-context.c b/src/st/st-theme-context.c
index 0e96cdb..7b676b7 100644
--- a/src/st/st-theme-context.c
+++ b/src/st/st-theme-context.c
@@ -129,10 +129,11 @@ on_stage_destroy (ClutterStage *stage)
   g_object_unref (context);
 }
 
-static void
+static gboolean
 emit_changed (StThemeContext *context)
 {
   g_signal_emit (context, signals[CHANGED], 0);
+  return FALSE;
 }
 
 static void
@@ -156,7 +157,7 @@ on_icon_theme_changed (StTextureCache *cache,
    * 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. */
-  emit_changed (context);
+  g_idle_add ((GSourceFunc) emit_changed, context);
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]