Xfce Bug Tracker

Sub domains
 
Menu with <OnlyUnallocated/> disappears after adding new entries with xdg-des...
Status:
NEW
Priority:
Medium
Severity:
normal

Comments

Description Marek Marczykowski-Górecki 2016-07-15 04:28:40 CEST
Created attachment 6737 [details]
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 [details]
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 [details]
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).
Note You need to log in before you can comment on or make changes to this bug.

Bug #12700

Reported by:
Marek Marczykowski-Górecki
Reported on: 2016-07-15
Last modified on: 2017-12-16 Show history

People

Assignee:
Eric Koegel
CC List:
2 users show

Version

Version:
unspecified

Attachments

Toplevel menu description. (1.53 KB, application/octet-stream)
2016-07-15 04:28 CEST, Marek Marczykowski-Górecki
no flags Details
12700.patch (1.42 KB, patch)
2017-12-14 23:00 CET, Yegor Timoshenko
no flags Details
0001-Decrement-allocation-counter-on-item-unref-12700.patch (2.06 KB, patch)
2017-12-15 02:03 CET, Yegor Timoshenko
no flags Details

Additional information