Whisker menu and Menulibre

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Fixer1234

Whisker menu and Menulibre

Post by Fixer1234 »

I installed Mint Xfce 17, which came with the Whisker applications menu and Menulibre as the menu editor. Like others, I experienced the menu editor working once and then not opening at all. And like others, I tried Alacarte, which also worked once. Although it would subsequently open, it had very little functionality in terms of changing the menu. Opening Menulibre in the terminal produced this message, which others have also reported:

ERROR: /build/buildd/gnome-menus-3.10.1/./libmenu/gmenu-tree.c:4022:preprocess_layout_info: assertion failed: (!directory->preprocessed)
Aborted

The menu editor problem seems to have been around for at least three or four versions of Mint Xfce. People have found fixes and workarounds for specific versions but the underlying problem seems to have persisted. I'll leave out discussion of most of the things I explored as none of the other suggested fixes worked and don't really appear to be relevant to the underlying problem.

I found a discussion of the issue which suggested deleted the folder ~/.config/menus/. I did this and Menulibre opens again and provides the ability to edit a menu, However, the menu it now works on does not reflect what Whisker displays. An example: Mint Xfce does not pre-install Wine, which I did. Wine and a few associated items then appeared in a separate Whisker menu "node" called "Wine". Opening the menu in Menulibre, there is no Wine node in the menu and if I recall correctly, the Wine-related items appear under "Other". I did some trial adjusting in Menulibre, but those changes are not reflected when the menu is opened in Whisker. The "fix" of deleteing the menus directory apparently eliminates a menu file that gave Menulibre indigestion, but that is obviously a key part of what the editor needs.

A lttle exploration shows that the menu that Whisker displays is a composite of pieces stored in numerous places. It looks like the menu structure is cobbled together from chunks in a number of places and within that, the descriptive part of the structure is stored separately from the application "content" of the menu. It looks like each menu "node" directory has its own descriptive file, and even these are not all stored in the same directory. In short, getting this to work is not a simple matter of just pointing the menu editor to the right menu data file. It is necessary for the menu to be preprocessed, as referred to in the error message.

Mint Xfce 17 was released in "final" form but it looks like this was done without a properly configured menu editor. Menulibre isn't using the same (or a complete version of), the menu Whisker is using and it looks like the first time it writes a revision to the initial menu, it corrupts something that prevents Menulibre from subsequently working with the menu again.

Does anyone know if this is being fixed or if there is an alternate solution--either a way for the end-user to recompile the menu and get Whisker and Menulibre talking again, or an alternate menu and/or menu editor that will work with Mint Xfce 17? Thanks.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
dollyp
Level 3
Level 3
Posts: 139
Joined: Sun Jul 24, 2011 4:50 pm

Re: Whisker menu and Menulibre

Post by dollyp »

There is a recent thread on the Ubuntu forum about a similar fault, which the author of MenuLibre responds to. I haven't tried to use MenuLibre yet myself as I'm staying with Mint16 for a little while yet, but the update may be worth a try.
http://ubuntuforums.org/showthread.php?t=2225714

Post back whether it was successful.

Regards
David
Fixer1234

Re: Whisker menu and Menulibre

Post by Fixer1234 »

Thanks for your reply. Looks like it might be a good suggestion. I thought Mint 17 already includes the "corrected" version of Menulibre but since the problem exists exactly like the known bug, it must not. I did uninstall what came with the Mint Xfce distribution and reinstalled the latest version directly from the publisher. However, the "complete" fix raises another problem. It requires reloading an old version of the menu file in ~/.config/menus (in original, uncorrupted condition). Do you know how to download a virgin copy of just that file as contained in the original distribution iso?
dollyp
Level 3
Level 3
Posts: 139
Joined: Sun Jul 24, 2011 4:50 pm

Re: Whisker menu and Menulibre

Post by dollyp »

Fixer1234 wrote:It requires reloading an old version of the menu file in ~/.config/menus (in original, uncorrupted condition). Do you know how to download a virgin copy of just that file as contained in the original distribution iso?
Sorry, unless you have a backup to go back to I don't know the answer to this. If this is your first foray into xfce and you don't have an existing menu setup then I would assume that just deleting the contents of ~/.config/menus would give you back an out-of-box menu system. Back it up first in case I'm wrong.

Regards
David
Fixer1234

Re: Whisker menu and Menulibre

Post by Fixer1234 »

It looks like deleting the contents of ~/.config/menus deletes the out-of-box menu system and there is no obvious way to re-create it. I hadn't yet backed up the system because I was still setting it up, but have enough time invested that I was hoping not to have to start over. I'll post a new thread about getting component files from the iso. Thanks for your help and the lead on the Menulibre bug.
koala
Level 1
Level 1
Posts: 3
Joined: Mon Dec 16, 2013 8:35 am

Re: Whisker menu and Menulibre

Post by koala »

Fixer1234 wrote:... It requires reloading an old version of the menu file in ~/.config/menus (in original, uncorrupted condition). Do you know how to download a virgin copy of just that file as contained in the original distribution iso?
After several changes, MenuLibre is already broken.
The solution is to restore the original configuration and repeat the operation.
I saved the original file, so you can download it from here (see in attachment).
The file need to be replaced in /home/user/.config/.menus/



You must change the file extension from .doc to .menu (because the forum rules do not allow for uploading such file with .menu extensions).
dollyp
Level 3
Level 3
Posts: 139
Joined: Sun Jul 24, 2011 4:50 pm

Re: Whisker menu and Menulibre

Post by dollyp »

Fixer1234 wrote:It looks like deleting the contents of ~/.config/menus deletes the out-of-box menu system and there is no obvious way to re-create it. I hadn't yet backed up the system because I was still setting it up, but have enough time invested that I was hoping not to have to start over. I'll post a new thread about getting component files from the iso. Thanks for your help and the lead on the Menulibre bug.
And thanks for saving me from my own ignorance. :oops: :D

David
Fixer1234

Re: Whisker menu and Menulibre

Post by Fixer1234 »

koala wrote:
Fixer1234 wrote:... It requires reloading an old version of the menu file in ~/.config/menus (in original, uncorrupted condition). Do you know how to download a virgin copy of just that file as contained in the original distribution iso?
After several changes, MenuLibre is already broken.
The solution is to restore the original configuration and repeat the operation.
I saved the original file, so you can download it from here (see in attachment).
The file need to be replaced in /home/user/.config/.menus/



You must change the file extension from .doc to .menu (because the forum rules do not allow for uploading such file with .menu extensions).
THANK YOU! I was trying to figure out how to backup and restore everything else for a fresh Xfce install without having the backup files mess up other stuff. The bug in Menulibre was known at the time Mint Xfce was released (at least the RC). The team really should create some type of patch that replaces Menulibre with the corrected version and re-installs the clean menu file. I'm just glad you had the foresight to backup the original. Thanks again.
Fixer1234

Re: Whisker menu and Menulibre

Post by Fixer1234 »

dollyp wrote:And thanks for saving me from my own ignorance. :oops: :D

David
You're forgiven, just don't let it happen again. :shock:
Hey, if you're willing to spend your time helping other people, you get a lot of slack when it comes to the occasional, well-intentioned mistake. Actually, what you advised was the same thing recommended by others. People found that deleting the corrupted menu file allowed Menulibre to work again. They just didn't investigate far enough to realize that it was no longer working with the same file Whisker uses.
Fixer1234

Re: Whisker menu and Menulibre

Post by Fixer1234 »

Well, bad news. It looks like Menulibre isn't ready for use in Mint. There was a bug in version 2.0.3-1, which was what was in the Ubuntu version on which Mint Xfce 17 RC was built. Version 2.0.4 of Menulibre corrects the bug and this is supposedly available in Ubuntu 14.10 and at some point 14.04. I don't know what version of Menulibre is included in the final release of Mint Xfce 17. Menulibre 2.0.4 is available from the developer's repository. Unfortunately, it is not configured to work properly in Mint Xfce 17.

It appears that when the menu system is bundled into the distribution iso, it is preprocessed for the default applications as contained in the distribution. Once installed, modification is a messy process. It looks like changes to items in the original menu may get changed in the original menu file. However, installing new applications or using the menu editor to add new items creates additional menu chunks that are just incorporated by reference into the menu. Menulibre, as configured from the developer's repository, doesn't look in the places Xfce stores the additional chunks and doesn't handle some other changes in the same way Whisker interprets them. In fact, it apparently doesn't know to how to read its own changes.

An example: After installing Mint Xfce, I added Wine and some associated applications. A new menu chunk was automatically created for Wine, with many of the associated applications also contained in it. Other of the applications showed up scattered in various locations in the main menu, apparently based on category tags in the apps. The menu Whisker displays includes the Wine "node" and the scattered Wine-related apps.

Menulibre, the corrected version, was installed after this. I reloaded the out-of-box version of the menu file. Menulibre does not find the Wine chunk of the menu. Using Menulibre, I added a Wine node and added one application under it. Returning to Whisker, It now shows the Wine node I added in addition to the one it previously recognized. So Menulibre doesn't work with the entire menu, but at least it now talks to Whisker. However, going back to Menulibre, it no longer sees the changes it just made (stored in additional files in the same directory as the main menu). It returns to the virgin menu file. I thought it might be possible to just uninstall the applications I had added and then reinstall them to bring the menu up-to-date. However, Menulibre isn't configured to look in the same places as Whisker, and is lost in its underwear as far as recognizing its own changes.

Bottom line: until the Mint Xfce team bundles a version of Menulibre that both has the bug fixed and is configured to work with the Xfce directory structure and Whisker, Xfce lacks a working menu editor.

So new question: has anyone figured out a working menu editor solution (some combination of menu and menu editor that work properly in Xfce and play well together)?

EDIT: FYI, the "final" release of Xfce 17 still contains the defective version of Menulibre (ver. 2.0.3-1).

EDIT 2: Version 2.0.4 of Menulibre is available through the software manager. Unfortunately, it is at least as buggy as trying to run the version from the developer's repository. It can't find chunks of menu, including the ones it creates, itself. If you run it in the terminal, you get page after page of error messages, mostly missing processes associated with program execution.
iainrs
Level 2
Level 2
Posts: 53
Joined: Mon Nov 07, 2011 5:14 pm

Re: Whisker menu and Menulibre

Post by iainrs »

Sorry to resurrect an old and well-worn topic.

I have just returned to Linux Mint (17 XFCE) having used Solydxk-XFCE for the last year or so.

I was influenced in my change by a very good review on MintCast and have been very pleased with my decision so far.

However one of my problems I had was that I had broken the 'menu update' system (Alacarte in that case). Now I have a nice new clean system and was looking forward to updating menus more easily with Menulibre. But over the last two days I have struggled to work out how and what MenuLibre was doing and then realised others were doing the same.

The basic problem seems to be the overly-complicated (from a simple user's point of view) menu structure imposed by the XDG (see https://developer.gnome.org/menu-spec/ and https://wiki.xfce.org/howto/customize-menu) and the desire for all-purpose menu programs (and editors) to cope with multiple Desktop Environments.

Since there seems to be no quick solution in sight can I ask if there are any simple rules to protect against broken menu systems ? Specifically in knowing which folders and files to back-up on a regular basis so that I can always revert to a previously working menu structure.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Whisker menu and Menulibre

Post by roblm »

I would recommend installing an older version (Raring) of MenuLibre for now. That's what I did and it has worked fine so far. It also
worked well in Mint 16 Xfce. The only difference in the two versions is that the newer one can also hide menu categories and create
new ones. First open the Synaptic Package Manager and remove the installed version.
It's a shame because I recently tested the newest version of Xubuntu, which is Ubuntu with the Xfce desktop, and the newer Menulibre
version worked flawlessly on it.

You can use the link below to get the Raring version:
https://launchpad.net/~menulibre-dev/+a ... untu/devel

Or just copy these two lines:
deb http://ppa.launchpad.net/menulibre-dev/devel/ubuntu raring main
deb-src http://ppa.launchpad.net/menulibre-dev/devel/ubuntu raring main

Then open Software Sources and click on "Additional repositories". Click on "Add a new repository", and paste the two lines. Click OK.

Now get the “Signing key” from the site above, which is 1024R/A7AD98A1. You need to copy the last 8 characters, which is A7AD98A1.
In Software Sources click “Authentication keys”. Click “Download a key”. Paste the key you just copied into the window. Click OK and
then click “Update the cache”.

Open the Terminal and type:
sudo apt-get install menulibre

At first, when you right click the Whisker menu icon, the selection “Edit Applications” will be grayed out, so it won't be usable. To enable
this function, right click on the menu icon and click “Properties”. Click the “Behavior” tab. On the “Edit Applications” line, click the icon on
the right, to find the path to menulibre. Go to “/opt/ubuntu.com/menulibre/bin/menulibre”. Click “OK”.

When using this version, you must click the save icon after every change that's made. Which means you can't make two or more
changes and then click the save icon. After clicking the icon, wait until it turns a light gray color before making the next change.

Or if you prefer to customize the old Xfce Applications menu like I do, then you can follow my instructions in this topic:
http://forums.linuxmint.com/viewtopic.php?f=47&t=160784

This topic also has information on how to hide menu categories in the Whisker menu, by editing it's configuration file, which is found at
“/home/user-name/.config/menus/xfce-applications.menu”.

I use MenuLibre to hide applications I don't use and edit the Xfce Applications menu configuration file to rearrange the menu or to hide
or create categories.

EDITED: On a new installation and after installing all the updates before opening Menulibre, the menu editor now works fine with the Whisker
Menu and the Xfce Applications Menu. I did not install the updates on my first installation. If you opened MenuLibre first and it quit working,
before installing the updates, then delete the file "xfce-applications.menu" in "/home/user-name/.config/menus". A new one will be created.
Last edited by roblm on Fri Aug 22, 2014 8:23 am, edited 3 times in total.
Fixer1234

Re: Whisker menu and Menulibre

Post by Fixer1234 »

Actually, the issue, in this case, isn't even the "overly-complicated" menu structure. That just makes it difficult to fix. There is a menu standard and the basic rules are straightforward. The standard is designed for a multi-user environment, where there is a generic basic menu structure that every user gets by default. Any user customizations get layered on top as exceptions or modifications. There are numerous ways to define those modifications and numerous potential places to stick them. Any menu system or menu editor is supposed to look in all of the possible places and merge everything it finds. There are rules for how to handle situations where those chunks are in conflict or are ambiguous. However, this goes only as far as ensuring that program execution doesn't stop. The menu definition can get very convoluted, making It difficult to trace or predict the specific result from applying those rules.

In the Mint distributions (and I'm guessing others), the package may include the generic basic menus for several of the available desktops. There are differences in the software bundles that are included with the different desktops and in their default menu structures. In the case of Mint Xfce, it looks like the whole menu system was lifted from somewhere else (with minimal reconfiguration for Mint). The Gnome menu files from that source are included in the Mint distribution along with the Xfce menu files. Gnome isn't even one of the Mint desktop offerings. Buried in the menu chunks are references to Ubuntu, Xubuntu, Debian, Fedora, SUSE, etc.

The problem is not in the definition files for the menu, itself, at least not primarily. It is in defining how to select the collection of files to base the menu on. It looks in one place to learn the next place to look for its basic assumptions for what files to look at. It is a convoluted chain, and where it leads may not even be based on what is explicitly defined, but on rules for what to do if it is not.

As to how it gets corrupted, there are several things going on. Menulibre actually has programming bugs in all of the versions currently bundled with Mint or downloadable for Mint. Moving beyond that, the Mint implementations of the Whisker and Xfce menus, and Menulibre and Alacarte, are sloppy. I was never able to track the details to the precise source, but at least some of the menu-related programs believe that they should be using the basic Gnome menu files instead of the Xfce menu files (it appears to be a missing environment variable, although it could be that the environment variable is optional and there is another default assumption buried somewhere for what to use if it is missing, or in the absence of this specification, the program just uses the first file it encounters in its search of standard directories). Further, each menu program (Whisker and Xfce) and menu editor (Menulibre and Alacarte) is configured (or reads configuration information), to handle the system of component menu files differently. With no two programs working with the same files in the same way, there is no method to modify your applications menu in a predictable way. Trying to do so will give you brain damage.

I spent days trying to clean up or recreate a working set of menu files but was never able to control the initial configurations that tell the programs what files to start with. I thought I got to a working combination. The menu editor would launch without crashing. I could modify some stuff in the editor. The menu would subsequently reflect all or most of the changes. Then I would go back into the menu editor and it was back to using the original, unmodified files. The menu structure in the Whisker menu never matched the one in the Xfce menu (accessible from the system tray), even though they are supposed to be using the same files. The menu structures in Menulibre and Alacarte never exactly matched each other or the ones in either menu program. After wasting a week on it, I finally gave up.

I had picked Xfce because it was running on an old XP machine. Xfce has low resource requirements and pretty much reproduces the functionality of XP. It's light and fast and covers all of the basics. I really liked (Mint 17) Xfce in general, but when I couldn't get the menu system to work, I tried other distros based on Xfce. The menu system and editor worked in other distros but they lacked the utilities and needed drivers supplied with Mint, and/or their software repositories weren't as good. I finally came back to Mint and loaded Mate. The computer has 1 GB RAM and Mate runs fine in it. It's like an enhanced version of Xfce and the Mate release is ready for prime time. If your computer has at least 1 GB of RAM, that's really the way to go for now.

If you want to dabble and are looking for what to back up, there are four "high level" directories that should contain the directories, trees, and snippets of menu components. Two of these contain the generic default files: /usr/share/ and /etc/xdg/. These also contain tons of other stuff. If you follow the menu standard "rules", the menu pieces in these directories should not change, so you shouldn't need more than normal backup. If you load new software, it will add files used by the menu system so backup when you install new stuff. The user customization will be within $home/.local/share/ and $home/.config/. $home is normally /home/<username>/. I would just backup the entire home directory, which is a good practice. You can always exclude stuff like the trash directory and big directories that don't change, like most of a virtual machine or Wine directory.

Edit: the full spec for the menu system and how it is supposed to work is here: http://standards.freedesktop.org/menu-s ... index.html
Fixer1234

Re: Whisker menu and Menulibre

Post by Fixer1234 »

If anyone is still experimenting, trying to make the Xfce menu and menu editor work, let me throw out something to try. When I wrote the last post, something occurred to me that I had not tried when I was trying to make it work. It's been some weeks since I gave up and loaded Mate, and I tossed the better part of 100 pages of notes from tracing through the menus and python code, so this is from memory.

The menu-related programs start by reading environment variables that define where to look (collection of potential directories), for the files that define the menu. At least some of them also look for an environment variable that identifies what the desktop is. It uses this for the prefix of the base menu name. That selects the core menu that other things get layered on. The "user" menu that serves as a starting point for customization that is supplied with the distro contains a merge specification for the Xfce core menu. At least one of the menu-related programs somehow identified Gnome as the prefix for the core menu. It was looking for an environment variable that was not there, but it got Gnome from somewhere and I never figured out where.

The programs are all supposedly based on the freedesktop.org menu system specification. The general rule for handling ambiguity is, for whatever the item is, to use the first example encountered and to ignore any subsequent ones. When looking for a file, I assume the operational definition of "first" is the order something was originally stored in a file table. The only relevant Gnome-related items I found were the Gnome menu items included in the distribution. If the file lists were built in alphabetical order, Gnome would come before Xfce when selecting something based on the order encountered.

Here is my suggestion to try. The Gnome menus should not be needed (unless somebody left the reference in a configuration file somewhere and one or more of the menu-related programs won't work at all if it can't find a Gnome menu). My recollection is that the core menus are in /etc/xdg/menus/. The core Gnome menu is called something like gnome-application.menu. There might be additional ones with a gnome prefix there or in a subdirectory called something like application-merged. This is from memory, so you might have to explore a little to find them if it isn't exactly that.

Temporarily rename the suffix of anything with a .menu suffix and a gnome prefix, or move them into an archive (the directory list that is searched for menu components is pretty extensive, so just moving the files might move them to another searched directory). For that matter, you probably need to rename any .menu file that has a desktop prefix if the prefix is something other than xfce. I would reboot after this because some menu-related settings respond immediately to changes and some persist. BTW, all of the menu files that are part of the core set and are not located in the home directory tree will require root privileges to change.

If the Gnome menus were being used only because of the ambiguity rules, leaving only the Xfce menus might solve at least one of the problems caused by the inconsistent menu files.
WoodLark

Re: Whisker menu and Menulibre

Post by WoodLark »

I renamed the gnome menu entries in /etc/xdg/menus from an extension of .menu to ._menu_.

They were the only menu files there besides xfce menus. It didn't help!

I am going to consider switching to mate if I can do it without a complete reinstall.
Locked

Return to “Xfce”