lxde / menu-cache Goto Github PK
View Code? Open in Web Editor NEWLibrary used to read freedesktop.org menus
Home Page: http://git.lxde.org/gitweb/?p=lxde/menu-cache.git
License: GNU Lesser General Public License v2.1
Library used to read freedesktop.org menus
Home Page: http://git.lxde.org/gitweb/?p=lxde/menu-cache.git
License: GNU Lesser General Public License v2.1
Making all in menu-cache-gen
make[2]: Entering directory '/tmp/trizen-han/menu-cache-git/src/menu-cache/menu-cache-gen'
CC menu-merge.o
CC menu-compose.o
CC main.o
CCLD menu-cache-gen
/usr/bin/ld: menu-merge.o:(.bss+0xac): multiple definition of menuTag_Menu'; main.o:(.bss+0xac): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x0): multiple definition of
verbose'; main.o:(.bss+0x0): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x10): multiple definition of AppDirs'; main.o:(.bss+0x10): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x40): multiple definition of
menuTag_Layout'; main.o:(.bss+0x40): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x3c): multiple definition of menuTag_DefaultLayout'; main.o:(.bss+0x3c): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x20): multiple definition of
MenuFiles'; main.o:(.bss+0x20): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x6c): multiple definition of menuTag_Name'; main.o:(.bss+0x6c): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x68): multiple definition of
menuTag_Deleted'; main.o:(.bss+0x68): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x64): multiple definition of menuTag_NotDeleted'; main.o:(.bss+0x64): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x70): multiple definition of
menuTag_Directory'; main.o:(.bss+0x70): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x60): multiple definition of menuTag_OnlyUnallocated'; main.o:(.bss+0x60): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x5c): multiple definition of
menuTag_NotOnlyUnallocated'; main.o:(.bss+0x5c): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x98): multiple definition of menuTag_Include'; main.o:(.bss+0x98): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x94): multiple definition of
menuTag_Exclude'; main.o:(.bss+0x94): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0xa0): multiple definition of menuTag_DirectoryDir'; main.o:(.bss+0xa0): first defined here /usr/bin/ld: menu-merge.o:(.bss+0xa8): multiple definition of
menuTag_AppDir'; main.o:(.bss+0xa8): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x54): multiple definition of menuTag_LegacyDir'; main.o:(.bss+0x54): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x88): multiple definition of
menuTag_And'; main.o:(.bss+0x88): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x8c): multiple definition of menuTag_Or'; main.o:(.bss+0x8c): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x90): multiple definition of
menuTag_Filename'; main.o:(.bss+0x90): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x80): multiple definition of menuTag_Category'; main.o:(.bss+0x80): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x58): multiple definition of
menuTag_All'; main.o:(.bss+0x58): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x74): multiple definition of menuTag_DefaultMergeDirs'; main.o:(.bss+0x74): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x78): multiple definition of
menuTag_MergeDir'; main.o:(.bss+0x78): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x7c): multiple definition of menuTag_MergeFile'; main.o:(.bss+0x7c): first defined here /usr/bin/ld: menu-merge.o:(.bss+0xa4): multiple definition of
menuTag_DefaultAppDirs'; main.o:(.bss+0xa4): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x50): multiple definition of menuTag_KDELegacyDirs'; main.o:(.bss+0x50): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x9c): multiple definition of
menuTag_DefaultDirectoryDirs'; main.o:(.bss+0x9c): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x4c): multiple definition of menuTag_Move'; main.o:(.bss+0x4c): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x18): multiple definition of
MenuDirs'; main.o:(.bss+0x18): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x48): multiple definition of menuTag_Old'; main.o:(.bss+0x48): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x44): multiple definition of
menuTag_New'; main.o:(.bss+0x44): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x8): multiple definition of DirDirs'; main.o:(.bss+0x8): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x84): multiple definition of
menuTag_Not'; main.o:(.bss+0x84): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x38): multiple definition of menuTag_Menuname'; main.o:(.bss+0x38): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x34): multiple definition of
menuTag_Separator'; main.o:(.bss+0x34): first defined here
/usr/bin/ld: menu-merge.o:(.bss+0x30): multiple definition of menuTag_Merge'; main.o:(.bss+0x30): first defined here /usr/bin/ld: menu-merge.o:(.bss+0x28): multiple definition of
languages'; main.o:(.bss+0x28): first defined here
/usr/bin/ld: menu-compose.o:(.bss+0x0): multiple definition of `verbose'; main.o:(.bss+0x0): first defined here
EDIT:
Solution (intstructions) here > http://www.linuxfromscratch.org/blfs/view/svn/lxde/menu-cache.html
SF download link here > https://downloads.sourceforge.net/lxde/menu-cache-1.1.0.tar.xz
Patch from LFS > http://www.linuxfromscratch.org/patches/blfs/svn/menu-cache-1.1.0-consolidated_fixes-1.patch
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):
<Menu>
<Name>Menu1</Name>
<Directory>1.directory</Directory>
<Include>
<And>
<Category>One</Category>
<Not><Category>Three</Category></Not>
</And>
</Include>
</Menu>
<Menu>
<Name>Menu2</Name>
<Directory>2.directory</Directory>
<OnlyUnallocated/>
<Include>
<Not><Category>Foo</Category></Not>
</Include>
</Menu>
<Menu>
<Name>Menu3</Name>
<Directory>3.directory</Directory>
<OnlyUnallocated/>
<Include>
<Category>Three</Category>
</Include>
</Menu>
The test application:
[Desktop Entry]
Type=Application
Name=Test
Categories=One;Three;
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:
... entering Menu1 (1 dirs 1 apps)
found dir file /tmp/test/1.directory
... do matching
check test.desktop in /tmp/test: 1
menu_app_match_tag: entering <And>
menu_app_match_tag: entering <Category>
menu_app_match_tag test.desktop: leaving <Category>: 1
menu_app_match_tag: entering <Not>
menu_app_match_tag: entering <Category>
menu_app_match_tag test.desktop: leaving <Category>: 1
menu_app_match_tag test.desktop: leaving <Not>: 0
menu_app_match_tag test.desktop: leaving <And>: 0
... compose (available=0)
composing Merge type 2
composing Merge type 1
... cleanup
... done Menu1
+++ composing menu Menu1 (Menu1)
No match. Okay.
... entering Menu2 (1 dirs 1 apps)
Already wrong during the first pass.
found dir file /tmp/test/2.directory
... do matching
check test.desktop in /tmp/test: 1
menu_app_match_tag: entering <Not>
menu_app_match_tag: entering <Category>
menu_app_match_tag test.desktop: leaving <Category>: 0
menu_app_match_tag test.desktop: leaving <Not>: 1
found match: test.desktop excluded:0
Now the application is allocated, which is wrong.
... compose (available=1)
composing Merge type 2
composing Merge type 1
+++ composing app test.desktop
... cleanup
... done Menu2
+++ composing menu Menu2 (Menu2)
... entering Menu3 (1 dirs 1 apps)
Already wrong during the first pass.
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!
stage 2: counted 'Menu2': 0
stage 2: entered 'Menu3'
stage 2: counted 'Menu3': 1
stage 2: counted 'Applications': 1
stage 2: deleting empty 'Menu2'
stage 2: deleting empty 'Menu1'
In the end, the application is in the wrong <Menu>
(3 instead of 2).
BTW, the xfce menu builder does it right.
Hi! This is the copy of debian bug
Openbox-menu depends on this, as it fails to show top-level menus if there is a top-level menu created at user-level:
if top level menu is added on user level (in alacarte), then only this menu will be listed in output of openbox-menu. Other top-level menus from parent data are not shown.
If custom user-level menu is added inside other menu, it is handled properly.
Structure created by alacarte seems valid, alacarte created this structure in $XDG_CONFIG_HOME/menus/lxqt-applications.menu (comments added):
<?xml version="1.0" ?>
<!DOCTYPE Menu
PUBLIC '-//freedesktop//DTD Menu 1.0//EN'
'http://standards.freedesktop.org/menu-spec/menu-1.0.dtd'>
<Menu>
<Name>Applications</Name>
<MergeFile type="parent">/etc/xdg/menus/lxqt-applications.menu</MergeFile>
<DefaultLayout inline="false"/>
<Menu> <!--only this menu is shown among top-level menus by openbox-menu -->
<Name>alacarte-made</Name>
<Directory>alacarte-made.directory</Directory>
<Include>
<Filename>alacarte-made.desktop</Filename>
</Include>
<Layout>
<Merge type="menus"/>
<Merge type="files"/>
</Layout>
</Menu>
<Layout> <!-- i've tried to comment out the whole layout section, it does not make any difference -->
<Merge type="menus"/> <!-- all of these disappear if custom top-level menu above present -->
<Filename>lxqt-lockscreen.desktop</Filename>
<Filename>lxqt-about.desktop</Filename>
<Menuname>Multimedia</Menuname>
<Menuname>Graphics</Menuname>
<Menuname>Games</Menuname>
<Menuname>Internet</Menuname>
<Menuname>Hamradio</Menuname>
<Menuname>Education</Menuname>
<Menuname>Office</Menuname>
<Menuname>Development</Menuname>
<Menuname>Other</Menuname>
<Menuname>System</Menuname>
<Menuname>Universal Access</Menuname>
<Menuname>Accessories</Menuname>
<Menuname>Electronics</Menuname>
<Separator/>
<Menuname>DesktopSettings</Menuname> <!-- surprisingly, this menu and the separator above it are shown -->
<Separator/>
<Menuname>X-Leave</Menuname>
<Merge type="files"/>
</Layout>
</Menu>
sometimes, mostly after resume after hibernate menu-cached utilizes 100% cpu. SIGTERM as workaround helps.
I can deliver more info, but I dont know how.
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: menu-compose.o:(.bss+0x64): multiple definition of `menuTag_NotDeleted'; main.o:(.bss+0x64): first defined here
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: menu-compose.o:(.bss+0x68): multiple definition of `menuTag_Deleted'; main.o:(.bss+0x68): first defined here
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: menu-compose.o:(.bss+0x6c): multiple definition of `menuTag_Name'; main.o:(.bss+0x6c): first defined here
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: menu-compose.o:(.bss+0x70): multiple definition of `menuTag_Directory'; main.o:(.bss+0x70): first defined here
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: menu-compose.o:(.bss+0x74): multiple definition of `menuTag_DefaultMergeDirs'; main.o:(.bss+0x74): first defined here
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: menu-compose.o:(.bss+0x78): multiple definition of `menuTag_MergeDir'; main.o:(.bss+0x78): first defined here
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: menu-compose.o:(.bss+0x7c): multiple definition of `menuTag_MergeFile'; main.o:(.bss+0x7c): first defined here
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: menu-compose.o:(.bss+0x9c): multiple definition of `menuTag_DefaultDirectoryDirs'; main.o:(.bss+0x9c): first defined here
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: menu-compose.o:(.bss+0xa4): multiple definition of `menuTag_DefaultAppDirs'; main.o:(.bss+0xa4): first defined here
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: menu-compose.o:(.bss+0xac): multiple definition of `menuTag_Menu'; main.o:(.bss+0xac): first defined here
collect2: error: ld returned 1 exit status
a lot of redefinitions after gcc10 release
Easy to find with systemd and KillUserProcesses=Yes:
-- systemctl enable debug-shell
-- systemctl start debug-shell
-- issue a reboot or shutdown on a long enough running system
-- switch to VT9
-- pgrep -a -u $user
-- kill menu-cache, the shutdown or reboot will continue immediately
I use whiskermenu plugin in xfce and was thinking of integrating menu-cache into it to make the plugin more responsive. Doing this right now, will pull in only menu-cache
and libfm-extra
. These depend on glib2
which is anyway a dependency for Xfce.
But, if menu-cache
or libfm-extra
shift to Qt, I would need to pull in unnecessary dependencies. Can you confirm if these two packages have plans for porting to Qt?
So I cannot compile libfm because it's depended on menu-cache, but I can't compile menu-cache because it wants to me install libfm first.
OS: Solus (Linux)
Please, fix these weird requirements.
ref. lxqt/lxqt#65
....
Well, there is a tag there, it acts as for every
applications-merged/*.menu file under all menu search paths, so you may have tons
of from it actually, depending on their presence on your system.
Even without menu Other is still shown. However show/not show/ of this menu seems to be connected to it's definition. Now it is defined as:
<Include>
<And>
<Not><Category>Core</Category></Not>
<Not><Category>Settings</Category></Not>
<Not><Category>Screensaver</Category></Not>
</And>
</Include>
... if I add at least one "positive" , e.g:
<Include>
<And>
<Category>DontFindAnyOfSuchCategory</Category>
<Not><Category>Core</Category></Not>
<Not><Category>Settings</Category></Not>
<Not><Category>Screensaver</Category></Not>
</And>
</Include>
... the Other menu is not shown. This seems to me as a discrepancy (if not even a bug).
Binary menu-cached crashes and dumps core when file *.menu
it's monitoring gets removed.
After the crash menu-cached gets automatically started again (<--> different PID) but the crashes continue one second in four as long as *.menu
is missing.
Strack trace and backtrace after transferring the core dump to gdb via coredumpctl
on Arch Linux x86_64 can be found on https://gist.github.com/pmattern/d4f7751d8a68a3d45ec4.
Removing the *.menu
on purpose while a session is running doesn't make sense and should be avoided anyway. But a core dump is something that nonetheless justifies changing the daemon's behaviour, IMO. Also, at least on Arch Linux the small time span the *.menu
file is missing when its corresponding package gets updated can suffice to trigger the problem when the timing is matching.
As the daemon seems to check the file at regular intervals I figure it could be modified such that it ignores the lack of the file one or two checks.
Maybe another solution could be to make it exit gracefully and write a message to the syslog / systemd journal.
Seen with menu-cache 1.0.1 on Arch Linux x86_64 or i686 with LXQt from VCS and stable LXDE release as well as on Debian stretch x86_64 with LXQt 0.10.
To keep #11 some company:
menu-cached (spawned by openbox-menu) does not exit on logout from openbox session
This leaves a dangling session visible via loginctl list-sessions.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863226
You're
leads to segfaults.
In my case, one of the language-related environment variables happened to contain a newline, probably because of an unusual setup (no /etc/default/locale) and probably because one of the crafty init script writers decided to guess a "reasonable" default when none is present.
And this, in turn, is why my lxpanel hangs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.