icon-theme: Drop loading_themes recursion check
authorAlexander Larsson <alexl@redhat.com>
Tue, 28 Jan 2020 13:35:17 +0000 (14:35 +0100)
committerAlexander Larsson <alexl@redhat.com>
Wed, 29 Jan 2020 18:06:16 +0000 (19:06 +0100)
This was added in 0b1c9b7cc26d293477a6823a40d3e1feebbd6df7 to protect
against reentrancy from the theme-changed signal, but we only emit this
from an idle these days, so thats not necessary anymore, and the recursion
check was causing issues with the async operations where a different
thread loading the theme caused the calling thread to thing the
theme is valid.

gtk/gtkicontheme.c

index 1e1754e0136a5045d09cab417908a203ebc18ce0..ff9f307ab7d453fcb0b1befacddf30f60b5eb774 100644 (file)
@@ -218,7 +218,6 @@ struct _GtkIconTheme
   guint is_display_singleton : 1;
   guint pixbuf_supports_svg  : 1;
   guint themes_valid         : 1;
-  guint loading_themes       : 1;
 
   /* A list of all the themes needed to look up icons.
    * In search order, without duplicates
@@ -1628,10 +1627,6 @@ ensure_valid_themes (GtkIconTheme *self, gboolean non_blocking)
   gboolean was_valid = self->themes_valid;
   gint64 before = g_get_monotonic_time ();
 
-  if (self->loading_themes)
-    return TRUE;
-  self->loading_themes = TRUE;
-
   if (self->themes_valid)
     {
       g_get_current_time (&tv);
@@ -1666,7 +1661,6 @@ ensure_valid_themes (GtkIconTheme *self, gboolean non_blocking)
   if (gdk_profiler_is_running ())
     gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "icon theme load", NULL);
 
-  self->loading_themes = FALSE;
   return TRUE;
 }