From 55db9d07c53acbe01a9fc1e2013682e895ebcb28 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 28 Jan 2020 17:08:52 +0100 Subject: [PATCH] icon-theme: Only add theme load profiler mark if we actually load theme --- gtk/gtkicontheme.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 3b15af972d..3822b9b69b 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -1735,7 +1735,6 @@ ensure_valid_themes (GtkIconTheme *self, { GTimeVal tv; gboolean was_valid = self->themes_valid; - gint64 before = g_get_monotonic_time (); if (self->themes_valid) { @@ -1756,18 +1755,21 @@ ensure_valid_themes (GtkIconTheme *self, if (!self->themes_valid) { + gint64 before; if (non_blocking) return FALSE; + before = g_get_monotonic_time (); + load_themes (self); + if (gdk_profiler_is_running ()) + gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "icon theme load", NULL); + if (was_valid) queue_theme_changed (self); } - if (gdk_profiler_is_running ()) - gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "icon theme load", NULL); - return TRUE; } -- 2.30.2