Description Marek Marczykowski-Górecki 2016-07-15 04:28:40 CEST
Created attachment 6737
Toplevel menu description.
I have a menu configured with one submenu ("System Tools") in main menu file and others installed with xdg-desktop-menu install some.directory some.desktop.
After starting the session everything is ok, but after adding new entry, that "System Tools" submenu disappears. Removing "<OnlyUnallocated/>" bring it back (but now filled with all the entries, not only unallocated). Adding "<OnlyUnallocated/>" back make the category gone again. Until session restart.
Steps to reporduce:
1. Place attached xfce-applications.menu in /etc/xdg/menus, as a default menu
2. Check if "System Tools" menu is present.
3. Add new entry with xdg-desktop-menu install some.directory app1.desktop app2.desktop (those files exists and are valid desktop directory/entry descriptions).
4. Observe that "System Tools" is gone.
It's on Fedora 23-based system, garcon 0.4.0.
It worked fine on Fedora 20-based system, garcon 0.2.0.
Comment 1 Yegor Timoshenko 2017-12-14 21:51:40 CET
This is still an issue in garcon 0.6.1.
Comment 2 Yegor Timoshenko 2017-12-14 23:00:23 CET
Created attachment 7490
12700.patch
Here is patch that fixes this issue. Allocation counter was incremented on each config reload and was never decremented back.
Solved by adding garcon_menu_item_decrement_allocated() to garcon_menu_item_unref(), symmetrical to garcon_menu_item_increment_allocated() in garcon_menu_item_ref().
Please apply on top of garcon master.
Comment 3 Yegor Timoshenko 2017-12-15 02:03:18 CET
Created attachment 7491
0001-Decrement-allocation-counter-on-item-unref-12700.patch
Previous patch incorrectly handled <Exclude> allocation counter. Desktop Menu Specification says:
> Note that an entry that is included in a menu but excluded again by a later <Exclude> is still considered allocated (for the purposes of <OnlyUnallocated>) even though that entry no longer appears in the menu.
This version of the patch adds a change to increment allocation counter when garcon_menu_item_pool_filter_exclude() succeeds (i.e. when menu item is excluded).
Created attachment 6737 Toplevel menu description. I have a menu configured with one submenu ("System Tools") in main menu file and others installed with xdg-desktop-menu install some.directory some.desktop. After starting the session everything is ok, but after adding new entry, that "System Tools" submenu disappears. Removing "<OnlyUnallocated/>" bring it back (but now filled with all the entries, not only unallocated). Adding "<OnlyUnallocated/>" back make the category gone again. Until session restart. Steps to reporduce: 1. Place attached xfce-applications.menu in /etc/xdg/menus, as a default menu 2. Check if "System Tools" menu is present. 3. Add new entry with xdg-desktop-menu install some.directory app1.desktop app2.desktop (those files exists and are valid desktop directory/entry descriptions). 4. Observe that "System Tools" is gone. It's on Fedora 23-based system, garcon 0.4.0. It worked fine on Fedora 20-based system, garcon 0.2.0.
Created attachment 7490 12700.patch Here is patch that fixes this issue. Allocation counter was incremented on each config reload and was never decremented back. Solved by adding garcon_menu_item_decrement_allocated() to garcon_menu_item_unref(), symmetrical to garcon_menu_item_increment_allocated() in garcon_menu_item_ref(). Please apply on top of garcon master.