[gnome-shell] StTextureCache: do not monitor files inside GResource



commit 12b00501cc5eacc2c0bb63af98ea786892e96be8
Author: Cosimo Cecchi <cosimo endlessm com>
Date:   Wed Feb 4 12:23:30 2015 -0800

    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 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index d392844..5cc48e3 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,


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