help with "Xfce menu" on panel

Jason Keltz jas at cs.yorku.ca
Fri Feb 18 01:18:15 CET 2005


Brian J. Tarricone wrote:

> However, all the panel plugins, in general, always (and only) look for 
> config files in the user's home directory.  I'm not necessarily 
> disagreeing with you here though.  It does seem a bit inconsistent.

I still recommend that Xfce adopt a policy where-by plugins look in a 
users home directory first, and if a file is not there, they look in the 
global settings.  It seems this provides the most flexibility, and the 
least redundancy, allowing a user to keep in their home directory only 
files that are changed from the default.

> This is a bug then.  I thought the filename handler in the plugin was 
> expanding shell variables first, but I guess not.

I did more testing.  $XDG_CONFIG_HOME or ${XDG_CONFIG_HOME} do not work 
in the file path.  I will report this as a bug.

> This is mainly for historical reasons, but, really, the name of the 
> source file (or even the shared object) is irrelevant.  The only name 
> that's intended to be user-visible (and therefore describe its 
> function), is the name showed in the panel's Add Item dialog - "Xfce 
> Menu".

While I agree that the name is irrelevant to the average user, Xfce at 
present has a very clean source tree.  It is important to clean up 
things like this to keep it that way.  This is just a personal opinion 
though, and I know this has nothing to do with the actual running of the 
software.  I'd just like to see Xfce stay as clean as it is.

>> Finally, it appears that on top of all of this, the module does 
>> actually what I want/need it to do, but only for a little bit! There 
>> is definately a bug here....
>>
>> If I:
>> erase .config and .cache,
>> login,
>> add an "Xfce Menu" to the panel using the location of the global
>> "menu.xml" config file (which happens to be the default!)
>> add an entry to the "Desktop menu" using the "desktop menu" settings, 
>> and the "Edit desktop menu" button.  From what you have said, this 
>> should not update my Xfce menu.  However....
>> Now, when I click on the "Xfce Menu" on the panel, there is a pause as
>> it updates, and it actually does indeed update to show the entry that I
>> just added to the desktop menu!  If this continued to operate like 
>> this, I wouldn't have a problem.  It has indeed copied the desktop 
>> menu into my home directory, and that copy shows my change even 
>> though the properties of the "Xfce menu" still show that it is 
>> pointing at the global menu.xml file.
>>
>> If I then logout and then back in again, the "Xfce menu" on the panel
>> still displays my added setting to the desktop menu in my last session.
>> However, if I open up the "Settings" and add another item to the desktop
>> menu, and click on the "Xfce menu" on the panel, there is another 
>> pause as it reloads again, but this time it displays the original 
>> global menu.xml file without either of the changes that I just made.
>>
>> Now I'm definately confused!
>
>
> Yeah, so am I.  I'm betting the menu code doesn't properly remember 
> when it has its filename explicitly set over when it's just supposed 
> to use the default.
>
> I agree that this is confusing and somewhat inconsistent, though.  
> When I first wrote the plugin, it simply did as you currently expect: 
> it mirrored xfdesktop's menu, and did whatever it did.  Then someone 
> asked to be able to specify a menu filename, so they could either have 
> multiple buttons with different menus, or just have a different menu 
> than their desktop menu.  So I implemented that, but it seems the 
> original behavior got lost/broken somewhere in there.
>
> I think the real solution here is to change the plugin so it has a 
> "use default desktop menu" checkbox, which disables the filename entry 
> box (this should be the default, and it'll do exactly what you want).  
> Then, if the user decides to override that with a filename, it should 
> always use that filename, regardless of anything else that happens.  
> I'll try to fix this for 4.2.1.  If you wouldn't mind, could you open 
> a bug on bugzilla.xfce.org?  I probably won't be able to get to this 
> immediately, and I tend to forget things if I'm not reminded.

A "use default desktop menu" would solve this particular problem for me, 
but still leaves the generic problem that someone couldn't do the same 
thing with any other menu -- ie. having global settings that are used in 
the event that the user does not have the file.  Maybe, by default, if a 
person specifies a path not beginning with "/" for the XML file, the 
system could look in HOME/.config/xfce4/PATH. if that file doesn't 
exist, check in sysdir/etc/xdg/xfce4/PATH.  Clicking the "use default 
desktop menu" would simply specify "desktop/menu.xml" as the file.  If 
the user wanted to have other menus that have global defaults, this 
could be done with something like "panel/xfcemenu/menu1.xml".  That's 
just my personal opinion.  

I understand what you're thinking -- you wrote a module to allow you to 
provide the desktop menu as a plugin because that's what you needed.  
Someone wanted something else, and now I want something else, and I'm 
sure other people will want other things... I have ways of making Xfce 
do what I want to do through a hacks, but I just would prefer Xfce to do 
the work for me.
I appreciate your hard work on the module, and will report the issue as 
a bug. 

Thanks.

jas.



More information about the Xfce mailing list