Don't change XDG_MENU_PREFIX, just prefix menu cache, the same as libfm does.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Sat, 30 Aug 2014 19:46:11 +0000 (22:46 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sat, 30 Aug 2014 20:17:11 +0000 (23:17 +0300)
AUTHORS
debian/copyright
src/menu-policy.c

diff --git a/AUTHORS b/AUTHORS
index 6ae0908..ddf5c87 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -13,6 +13,7 @@ LXPanel - Lightweight X11 desktop panel
     Andriy Grytsenko <andrej@rep.kiev.ua>
     Giuseppe Penone <giuspen@gmail.com>
     Piotr Sipika <piotr.sipika@gmail.com>
+    Raimar Bühmann <raimar@buehmann.de>
 
 [History]
 LXPanel is a derivative work from fbpanel [1] written by Anatoly Asviyan,
index 2602ba9..f5049f4 100644 (file)
@@ -15,6 +15,7 @@ Copyright: Hong Jen Yee (PCMan)  <pcman.tw@gmail.com>
            Andriy Grytsenko <andrej@rep.kiev.ua>
            Giuseppe Penone <giuspen@gmail.com>
            Piotr Sipika <piotr.sipika@gmail.com>
+           Raimar Bühmann <raimar@buehmann.de>
 License: GPL-2+
 
 Files: src/bg.* src/ev.*:
index 6b97637..b4232a6 100644 (file)
 MenuCache * panel_menu_cache_new(guint32* visibility_flags)
 {
     MenuCache* cache;
-    if (g_getenv("XDG_MENU_PREFIX") == NULL)
-        g_setenv("XDG_MENU_PREFIX", "lxde-", TRUE);
+    gboolean need_prefix = (g_getenv("XDG_MENU_PREFIX") == NULL);
+
 #if MENU_CACHE_CHECK_VERSION(0, 5, 0)
     /* do it the same way menu:// VFS plugin in libfm does */
-    cache = menu_cache_lookup("applications.menu+hidden");
+    cache = menu_cache_lookup(need_prefix ? "lxde-applications.menu+hidden" : "applications.menu+hidden");
 #else
-    cache = menu_cache_lookup("applications.menu");
+    cache = menu_cache_lookup(need_prefix ? "lxde-applications.menu" : "applications.menu");
 #endif
     if(visibility_flags)
     {