You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first pass processes elements that can match any desktop entry (i.e. <Menu> with <NotOnlyUnallocated>, which is the default).
During this pass, each desktop entry is marked as allocated according to whether it was matched.
The second pass processes only <Menu> elements that are restricted to unallocated desktop entries (i.e. <OnlyUnallocated>).
During the second pass, queries may only match desktop entries that were not marked as allocated during the first pass.
menu-cache, however, already allocates for all <Menu> during the first pass and removes entries in the second pass from such <Menu> with <OnlyUnallocated>, which leads to wrong results.
Let's run a test case (all files attached) in /tmp/test.
In the first pass, the application is not allocated to Menu1 (which is correct), but to Menu3 (which is wrong, because this one is defined <OnlyUnallocated>, thus a second pass <Menu>).
In the second pass, the unallocated application was supposed to be allocated to Menu2, but instead it ends up in Menu3.
found dir file /tmp/test/3.directory
... do matching
check test.desktop in /tmp/test: 1
menu_app_match_tag: entering <Category>
menu_app_match_tag test.desktop: leaving <Category>: 1
found match: test.desktop excluded:0
As wrong as for Menu2 above.
... compose (available=1)
composing Merge type 2
composing Merge type 1
+++ composing app test.desktop
... cleanup
... done Menu3
+++ composing menu Menu3 (Menu3)
composing Merge type 1
... cleanup
... done Applications
stage 2: entered 'Applications'
stage 2: entered 'Menu1'
stage 2: counted 'Menu1': 0
stage 2: entered 'Menu2'
removing from Menu2 as only_unallocated test.desktop
It should not have been allocated to Menu3 at all!
The specification says:
<Menu>
with<NotOnlyUnallocated>
, which is the default).<Menu>
elements that are restricted to unallocated desktop entries (i.e.<OnlyUnallocated>
).menu-cache, however, already allocates for all
<Menu>
during the first pass and removes entries in the second pass from such<Menu>
with<OnlyUnallocated>
, which leads to wrong results.Let's run a test case (all files attached) in
/tmp/test
.The menu (only the essential parts):
The test application:
In the first pass, the application is not allocated to Menu1 (which is correct), but to Menu3 (which is wrong, because this one is defined
<OnlyUnallocated>
, thus a second pass<Menu>
).In the second pass, the unallocated application was supposed to be allocated to Menu2, but instead it ends up in Menu3.
Here is the (truncated) debug output:
No match. Okay.
Already wrong during the first pass.
Now the application is allocated, which is wrong.
Already wrong during the first pass.
As wrong as for Menu2 above.
It should not have been allocated to Menu3 at all!
In the end, the application is in the wrong
<Menu>
(3 instead of 2).BTW, the xfce menu builder does it right.
test.zip
The text was updated successfully, but these errors were encountered: