Chasing a problem in our Gnome customizations

July 12, 2005

Yesterday I talked about how I made a day-long excursion into the depths of Gnome, trying to chase down a problem we were having customizing Gnome's main menu, when I could have skipped most of the work by doing some Googling first. I thought it would be interested to give some more detail about the problem and the process I followed in finding it.

The problem was that we want a submenu for our local applications to appear on the default main applications menu. I had everything else necessary (such as the files that created the entries for the individual applications), but the submenu wasn't showing up; instead everything was showing up in an 'Other' menu.

My problem turned out to be because the XML file format for submenus had changed between Fedora Core 2 and Fedora Core 4; I needed a DTD declaration and a few other bits. But to find that I wound up going on a magical journey through the depths of /etc/gconf/schemas and the Gnome panel source.

The default Fedora Core 4 panel has three menu entries: Applications, Places, and Desktop. At first I assumed that the Panel schemas would have an explicit mention of and pointer to each of the menus, like it has explicit pointers for everything else on the default panel. Instead it didn't even have any mention of three menus.

By techniques including trying to add every gnome-panel item that looked promising to a test account's configuration, I discovered that all three menus were produced by a single panel object, the 'Menu Bar'. Examination of the XML schemas eventually persuaded me that this was an opaque gnome-panel object, menu-bar. (I didn't expect this partly because Red Hat had arranged for the Applications menu to have a little red fedora besides it, and I figured Red Hat would have done this by simply changing some XML definition file somewhere.)

At that point I yanked out the gnome-panel source code and started looking for where and how it created 'menu-bar' objects, which led me to discovering that it involved a file called '', which led me off to more or less verifying that this was how it worked in Fedora Core 2, which led me to looking at our submenu XML file versus some other, system-provided submenu files, and fixing the differences.

Looking back, my big problem in solving this efficiently was that I started with the implicit premise that what was wrong is that Fedora Core 4 had changed how Gnome generated the applications menu and submenus. So I started looking to find that, which led me down the path above. Had I started even with the assumption that FC4 worked the same as FC2 but that perhaps the exact format had changed, I would have jumped immediately to looking at our submenu XML file and comparing it to others.

(In a bonus irony, I am pretty sure that I went through this entire process of finding when setting up our localized Fedora Core 2 configuration a year ago. Clearly the details of how the Gnome panel generates those menus didn't stick in my memory.)

Written on 12 July 2005.
« Adding submenus to Gnome
The legend of Debian Linux »

Page tools: View Source, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Tue Jul 12 23:15:38 2005
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.