Author: kelnos
Date: 2009-02-24 00:57:47 +0000 (Tue, 24 Feb 2009)
New Revision: 29558

Modified:
   xfdesktop/trunk/NEWS
   xfdesktop/trunk/modules/menu/desktop-menu.c
Log:
menu: discard fiel change notifications on files we don't care about (bug 4979)

Modified: xfdesktop/trunk/NEWS
===================================================================
--- xfdesktop/trunk/NEWS        2009-02-24 00:57:17 UTC (rev 29557)
+++ xfdesktop/trunk/NEWS        2009-02-24 00:57:47 UTC (rev 29558)
@@ -1,6 +1,7 @@
 Xfce 4.6rc2 (Xfce 4.5.99.2):
 
   * Fix menu plugin crash when selecting custom menu file (bug 4879).
+  * Only regen the monitor on changes to files we care about (bug 4979).
 
 
 Xfce 4.6rc1 (Xfce 4.5.99.1):

Modified: xfdesktop/trunk/modules/menu/desktop-menu.c
===================================================================
--- xfdesktop/trunk/modules/menu/desktop-menu.c 2009-02-24 00:57:17 UTC (rev 
29557)
+++ xfdesktop/trunk/modules/menu/desktop-menu.c 2009-02-24 00:57:47 UTC (rev 
29558)
@@ -145,6 +145,7 @@
                                gpointer user_data)
 {
     XfceDesktopMenu *desktop_menu = user_data;
+    const gchar *filename;
     XfceMenuItemCache *cache = xfce_menu_item_cache_get_default();
     
 #ifdef DEBUG
@@ -154,6 +155,16 @@
         TRACE("entering (%d,%s)", event, buf);
     }
 #endif
+
+    /* bug #4979: only trigger on files we care about */
+    filename = thunar_vfs_path_get_name(event_path);
+    if(!g_str_has_suffix(filename, ".desktop")
+       && !g_str_has_suffix(filename, ".menu")
+       && !g_str_has_suffix(filename, ".directory"))
+    {
+        DBG("menu: ignoring change on \"%s\"", filename);
+        return;
+    }
     
     xfce_menu_item_cache_invalidate(cache);
     if(!desktop_menu->idle_id)

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to