From: Alexander Larsson Date: Tue, 28 Jan 2020 16:08:52 +0000 (+0100) Subject: icon-theme: Only add theme load profiler mark if we actually load theme X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~126^2~17 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=55db9d07c53acbe01a9fc1e2013682e895ebcb28;p=gtk4.git icon-theme: Only add theme load profiler mark if we actually load theme --- 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; }