[gtk] Revert "Ensure icon themes are loaded with other themes"



commit 64e026d0a960c729cf237e6b2f66a24d9a27f4dc
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 25 14:30:25 2020 -0500

    Revert "Ensure icon themes are loaded with other themes"
    
    This reverts commit 88d26b75491c9a329a836c0d91a8f85ee3bc77d1.
    
    This change caused GtkShortcutWindow to not work anymore,
    and we are fixing icon themes differently, anyway.

 gtk/gtkapplication.c      |  3 +--
 gtk/gtkicontheme.c        | 15 ++++++---------
 gtk/gtkiconthemeprivate.h |  2 --
 3 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index 6bea5400b6..82eea35e73 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -38,7 +38,7 @@
 #include "gtkmain.h"
 #include "gtkrecentmanager.h"
 #include "gtkaccelmapprivate.h"
-#include "gtkiconthemeprivate.h"
+#include "gtkicontheme.h"
 #include "gtkbuilder.h"
 #include "gtkshortcutswindow.h"
 #include "gtkintl.h"
@@ -218,7 +218,6 @@ gtk_application_load_resources (GtkApplication *application)
     iconspath = g_strconcat (base_path, "/icons/", NULL);
     gtk_icon_theme_add_resource_path (default_theme, iconspath);
     g_free (iconspath);
-    gtk_icon_theme_ensure_loaded (default_theme);
   }
 
   /* Load the menus */
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 820ef73348..38a0bd2761 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -762,6 +762,7 @@ do_theme_change (GtkIconTheme *self)
   blow_themes (self);
 
   queue_theme_changed (self);
+
 }
 
 static void
@@ -1269,7 +1270,6 @@ load_themes (GtkIconTheme *self)
   IconThemeDirMtime *dir_mtime;
   GStatBuf stat_buf;
   GList *d;
-  gint64 before = g_get_monotonic_time ();
 
   if (self->current_theme)
     insert_theme (self, self->current_theme);
@@ -1356,9 +1356,6 @@ load_themes (GtkIconTheme *self)
     g_message ("%s", s->str);
     g_string_free (s, TRUE);
   });
-
-  self->loading_themes = FALSE;
-    gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "icon theme load", 
self->current_theme);
 }
 
 static void
@@ -1366,6 +1363,7 @@ ensure_valid_themes (GtkIconTheme *self)
 {
   GTimeVal tv;
   gboolean was_valid = self->themes_valid;
+  gint64 before = g_get_monotonic_time ();
 
   if (self->loading_themes)
     return;
@@ -1391,12 +1389,11 @@ ensure_valid_themes (GtkIconTheme *self)
       if (was_valid)
         queue_theme_changed (self);
     }
-}
 
-void
-gtk_icon_theme_ensure_loaded (GtkIconTheme *self)
-{
-  ensure_valid_themes (self);
+  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;
 }
 
 static inline gboolean
diff --git a/gtk/gtkiconthemeprivate.h b/gtk/gtkiconthemeprivate.h
index 1c54944817..132d5154ee 100644
--- a/gtk/gtkiconthemeprivate.h
+++ b/gtk/gtkiconthemeprivate.h
@@ -27,6 +27,4 @@ void        gtk_icon_theme_lookup_symbolic_colors       (GtkCssStyle    *style,
                                                          GdkRGBA        *warning_out,
                                                          GdkRGBA        *error_out);
 
-void        gtk_icon_theme_ensure_loaded (GtkIconTheme *self);
-
 #endif /* __GTK_ICON_THEME_PRIVATE_H__ */


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