From 12b00501cc5eacc2c0bb63af98ea786892e96be8 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Wed, 4 Feb 2015 12:23:30 -0800 Subject: [PATCH] StTextureCache: do not monitor files inside GResource This is wasteful, since GResource does not support file monitoring. Further, doing so will trigger a fallback code path in GLib that polls every second in a thread, which is doubly wasteful. https://bugzilla.gnome.org/show_bug.cgi?id=744013 --- src/st/st-texture-cache.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index d39284410..5cc48e3fd 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -983,6 +983,12 @@ ensure_monitor_for_file (StTextureCache *cache, { StTextureCachePrivate *priv = cache->priv; + /* No point in trying to monitor files that are part of a + * GResource, since it does not support file monitoring. + */ + if (g_file_has_uri_scheme (file, "resource")) + return; + if (g_hash_table_lookup (priv->file_monitors, file) == NULL) { GFileMonitor *monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE,