From: "Alexey I. Froloff" <[email protected]>

Last group from a desktop file is always added to menu regardless of
NoDisplay property.  Properly handle the NoDisplay and Hidden properties
at the end of file.

Signed-off-by: Alexey I. Froloff <[email protected]>
---
 util/wmmenugen_parse_xdg.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/util/wmmenugen_parse_xdg.c b/util/wmmenugen_parse_xdg.c
index f39a83e..f5cdb58 100644
--- a/util/wmmenugen_parse_xdg.c
+++ b/util/wmmenugen_parse_xdg.c
@@ -119,13 +119,11 @@ void parse_xdg(const char *file, void 
(*addWMMenuEntryCallback)(WMMenuEntry *aEn
                        continue;
 
                if (strcmp(p, "[Desktop Entry]") == 0) {
-                       if (InGroup) {
-                               /* if currently processing a group, we've just 
hit the
-                                * end of its definition, try processing it
-                                */
-                               if (xdg_to_wm(&xdg, &wm)) {
-                                       (*addWMMenuEntryCallback)(wm);
-                               }
+                       /* if currently processing a group, we've just hit the
+                        * end of its definition, try processing it
+                        */
+                       if (InGroup && xdg_to_wm(&xdg, &wm)) {
+                               (*addWMMenuEntryCallback)(wm);
                        }
                        init_xdg_storage(&xdg);
                        init_wm_storage(&wm);
@@ -180,8 +178,10 @@ void parse_xdg(const char *file, void 
(*addWMMenuEntryCallback)(WMMenuEntry *aEn
 
        fclose(fp);
 
-       /* at the end of the file, might as well try to menuize what we have */
-       if (xdg_to_wm(&xdg, &wm))
+       /* at the end of the file, might as well try to menuize what we have
+        * unless there was no group at all or it was marked as hidden
+        */
+       if (InGroup && xdg_to_wm(&xdg, &wm))
                (*addWMMenuEntryCallback)(wm);
 
 }
-- 
1.7.10.2


-- 
To unsubscribe, send mail to [email protected].

Reply via email to