Debian support for XDG_MENU_PREFIX under GNOME

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Debian support for XDG_MENU_PREFIX under GNOME

Bastian, Waldo
Hi,

I'm trying to find out what the status is of Debian's support for XDG_MENU_PREFIX. In case you have no idea what XDG_MENU_PREFIX is, let me explain:

The XDG Menu Specification specifies the use of an applications.menu file to describe the menu layout. This implies a single menu layout regardless of desktop environment used. Some distributions (Debian in particular) wanted to have different menu layouts dependng on the desktpo environment used, and decided to prefix the applications.menu file with either "gnome-" or "kde-". Unfortunately this breaks applications that expect an applications.menu file to be used (as the specification says it will). To accommodate the need for different desktop layouts under different desktop environments, the XDG Menu Spec has been updated [1] and the notion of $XDG_MENU_PREFIX has been introduced. XDG_MENU_PREFIX indicates the prefix, if any, that is applied in front of "applications.menu". So if Debian is using "gnome-applications.menu" instead of "applications.menu", it will need to export XDG_MENU_PREFIX="gnome-"

That's the straightforward part. The hairy part is that XDG_MENU_PREFIX must _NOT_ be applied to the applications-merged directory. The rationale for this is that third party applications should be able to install menu extension in applications-merged that apply regardless of the desktop environment used. So far Debian did/does not follow this part of the specification and used/uses "gnome-appplications-merged" and "kde-applications-merged" instead of "applications-merged". Kevin Krammer recently patched KDE 3.5.x to correct this behavior for KDE under Debian. I was wondering whether this problem has been addressed at the GNOME side as well?

Note that it is the intention of LSB to require XDG Menu Spec compliance for LSB 3.2.

Cheers,
Waldo
 
[1] http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html

Intel Corporation - Channel Platform Solutions Group - Hillsboro, Oregon

Reply | Threaded
Open this post in threaded view
|

Re: Debian support for XDG_MENU_PREFIX under GNOME

Josselin Mouette
Le lundi 04 décembre 2006 à 10:59 -0800, Bastian, Waldo a écrit :

> Hi,
>
> I'm trying to find out what the status is of Debian's support for
> XDG_MENU_PREFIX. In case you have no idea what XDG_MENU_PREFIX is, let
> me explain:
>
> The XDG Menu Specification specifies the use of an applications.menu
> file to describe the menu layout. This implies a single menu layout
> regardless of desktop environment used. Some distributions (Debian in
> particular) wanted to have different menu layouts dependng on the
> desktpo environment used, and decided to prefix the applications.menu
> file with either "gnome-" or "kde-". Unfortunately this breaks
> applications that expect an applications.menu file to be used (as the
> specification says it will). To accommodate the need for different
> desktop layouts under different desktop environments, the XDG Menu
> Spec has been updated [1] and the notion of $XDG_MENU_PREFIX has been
> introduced. XDG_MENU_PREFIX indicates the prefix, if any, that is
> applied in front of "applications.menu". So if Debian is using
> "gnome-applications.menu" instead of "applications.menu", it will need
> to export XDG_MENU_PREFIX="gnome-"
Having this implemented with an environment variable is a very wrong
decision IMHO. Furthermore, there is no way such a thing can be
integrated in Debian as it conflicts directly with policy §9.9.

> That's the straightforward part. The hairy part is that
> XDG_MENU_PREFIX must _NOT_ be applied to the applications-merged
> directory. The rationale for this is that third party applications
> should be able to install menu extension in applications-merged that
> apply regardless of the desktop environment used. So far Debian
> did/does not follow this part of the specification and used/uses
> "gnome-appplications-merged" and "kde-applications-merged" instead of
> "applications-merged". Kevin Krammer recently patched KDE 3.5.x to
> correct this behavior for KDE under Debian. I was wondering whether
> this problem has been addressed at the GNOME side as well?
Indeed, as gnome-menus expands the menu name based on the patched name,
it is reading gnome-applications-merged.menu.

I'm all for patching gnome-menus (as well as gnome-panel and bug-buddy
if necessary) to read applications-merged.menu instead of
gnome-applications-merged.menu if this can help, but this will *not* be
done with an environment variable.
--
Josselin Mouette                /\./\

"Do you have any more insane proposals for me?"

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Debian support for XDG_MENU_PREFIX under GNOME

Bastian, Waldo
In reply to this post by Bastian, Waldo
>Le lundi 04 décembre 2006 à 10:59 -0800, Bastian, Waldo a écrit :
>> Hi,
>>
>> I'm trying to find out what the status is of Debian's support for
>> XDG_MENU_PREFIX. In case you have no idea what XDG_MENU_PREFIX is, let
>> me explain:
>>
>> The XDG Menu Specification specifies the use of an applications.menu
>> file to describe the menu layout. This implies a single menu layout
>> regardless of desktop environment used. Some distributions (Debian in
>> particular) wanted to have different menu layouts dependng on the
>> desktpo environment used, and decided to prefix the applications.menu
>> file with either "gnome-" or "kde-". Unfortunately this breaks
>> applications that expect an applications.menu file to be used (as the
>> specification says it will). To accommodate the need for different
>> desktop layouts under different desktop environments, the XDG Menu
>> Spec has been updated [1] and the notion of $XDG_MENU_PREFIX has been
>> introduced. XDG_MENU_PREFIX indicates the prefix, if any, that is
>> applied in front of "applications.menu". So if Debian is using
>> "gnome-applications.menu" instead of "applications.menu", it will need
>> to export XDG_MENU_PREFIX="gnome-"
>
>Having this implemented with an environment variable is a very wrong
>decision IMHO. Furthermore, there is no way such a thing can be
>integrated in Debian as it conflicts directly with policy §9.9.

Where can I find this policy?

>> That's the straightforward part. The hairy part is that
>> XDG_MENU_PREFIX must _NOT_ be applied to the applications-merged
>> directory. The rationale for this is that third party applications
>> should be able to install menu extension in applications-merged that
>> apply regardless of the desktop environment used. So far Debian
>> did/does not follow this part of the specification and used/uses
>> "gnome-appplications-merged" and "kde-applications-merged" instead of
>> "applications-merged". Kevin Krammer recently patched KDE 3.5.x to
>> correct this behavior for KDE under Debian. I was wondering whether
>> this problem has been addressed at the GNOME side as well?
>
>Indeed, as gnome-menus expands the menu name based on the patched name,
>it is reading gnome-applications-merged.menu.
>
>I'm all for patching gnome-menus (as well as gnome-panel and bug-buddy
>if necessary) to read applications-merged.menu instead of
>gnome-applications-merged.menu if this can help, but this will *not* be
>done with an environment variable.

It's the applications-merged directory.

Note that the environment variable doesn't need to control the behavior of the desktop environment, it should merily inform applications about the prefix that's used for the current session.

Cheers,
Waldo

Reply | Threaded
Open this post in threaded view
|

Re: Debian support for XDG_MENU_PREFIX under GNOME

Kevin Krammer
On Monday 04 December 2006 21:06, Bastian, Waldo wrote:

> Note that the environment variable doesn't need to control the behavior of
> the desktop environment, it should merily inform applications about the
> prefix that's used for the current session.

Just to make sure I understand correctly: the desktop environment actually
doesn't have to use the configured prefix, but instead it should set it in
case it has a hardcoded or otherwise configured one?

Because in this case we should probably fix my upstream patches and make sure
Debian's startkde sets the variable correctly.

Cheers,
Kevin
--
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Debian support for XDG_MENU_PREFIX under GNOME

Bastian, Waldo
In reply to this post by Bastian, Waldo
>> Note that the environment variable doesn't need to control the behavior
>of
>> the desktop environment, it should merily inform applications about the
>> prefix that's used for the current session.
>
>Just to make sure I understand correctly: the desktop environment actually
>doesn't have to use the configured prefix,

Correct, it could do so but it doesn't have to.

> but instead it should set it in
>case it has a hardcoded or otherwise configured one?

Yes.

>Because in this case we should probably fix my upstream patches and make
>sure Debian's startkde sets the variable correctly.
>
>Cheers,
>Kevin
>--
>Kevin Krammer, KDE developer, xdg-utils developer
>KDE user support, developer mentoring

Reply | Threaded
Open this post in threaded view
|

Re: Debian support for XDG_MENU_PREFIX under GNOME

Josselin Mouette
In reply to this post by Josselin Mouette
Le lundi 04 décembre 2006 à 20:54 +0100, Josselin Mouette a écrit :

> > That's the straightforward part. The hairy part is that
> > XDG_MENU_PREFIX must _NOT_ be applied to the applications-merged
> > directory. The rationale for this is that third party applications
> > should be able to install menu extension in applications-merged that
> > apply regardless of the desktop environment used. So far Debian
> > did/does not follow this part of the specification and used/uses
> > "gnome-appplications-merged" and "kde-applications-merged" instead of
> > "applications-merged". Kevin Krammer recently patched KDE 3.5.x to
> > correct this behavior for KDE under Debian. I was wondering whether
> > this problem has been addressed at the GNOME side as well?
>
> Indeed, as gnome-menus expands the menu name based on the patched name,
> it is reading gnome-applications-merged.menu.
>
> I'm all for patching gnome-menus (as well as gnome-panel and bug-buddy
> if necessary) to read applications-merged.menu instead of
> gnome-applications-merged.menu if this can help, but this will *not* be
> done with an environment variable.
I've committed all relevant changes (-menus, -panel, bug-buddy, eel2) to
our SVN.

The implementation is a bit hackish but it will avoid extraneous
conflicts: first, the library looks for gnome-applications.menu, and
falls back to applications.menu if the former doesn't exist. The merged
directory is applications-merged in both cases.

Cheers,
--
Josselin Mouette                /\./\

"Do you have any more insane proposals for me?"

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Debian support for XDG_MENU_PREFIX under GNOME

Bastian, Waldo
In reply to this post by Bastian, Waldo
Le lundi 04 décembre 2006 à 20:54 +0100, Josselin Mouette a écrit :

>> > That's the straightforward part. The hairy part is that
>> > XDG_MENU_PREFIX must _NOT_ be applied to the applications-merged
>> > directory. The rationale for this is that third party applications
>> > should be able to install menu extension in applications-merged that
>> > apply regardless of the desktop environment used. So far Debian
>> > did/does not follow this part of the specification and used/uses
>> > "gnome-appplications-merged" and "kde-applications-merged" instead of
>> > "applications-merged". Kevin Krammer recently patched KDE 3.5.x to
>> > correct this behavior for KDE under Debian. I was wondering whether
>> > this problem has been addressed at the GNOME side as well?
>>
>> Indeed, as gnome-menus expands the menu name based on the patched name,
>> it is reading gnome-applications-merged.menu.
>>
>> I'm all for patching gnome-menus (as well as gnome-panel and bug-buddy
>> if necessary) to read applications-merged.menu instead of
>> gnome-applications-merged.menu if this can help, but this will *not* be
>> done with an environment variable.
>
>I've committed all relevant changes (-menus, -panel, bug-buddy, eel2) to
>our SVN.
>
>The implementation is a bit hackish but it will avoid extraneous
>conflicts: first, the library looks for gnome-applications.menu, and
>falls back to applications.menu if the former doesn't exist. The merged
>directory is applications-merged in both cases.

Excellent, thank you so much.

Cheers,
Waldo

Reply | Threaded
Open this post in threaded view
|

Re: Debian support for XDG_MENU_PREFIX under GNOME

Loïc Minier
In reply to this post by Josselin Mouette
On Mon, Dec 04, 2006, Josselin Mouette wrote:
> The implementation is a bit hackish but it will avoid extraneous
> conflicts: first, the library looks for gnome-applications.menu, and
> falls back to applications.menu if the former doesn't exist. The merged
> directory is applications-merged in both cases.

 How (or where) was this received upstream?

 What do other distros do?

--
Loïc Minier <[hidden email]>


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Debian support for XDG_MENU_PREFIX under GNOME

Josselin Mouette
Le mardi 05 décembre 2006 à 11:32 +0100, Loïc Minier a écrit :
> On Mon, Dec 04, 2006, Josselin Mouette wrote:
> > The implementation is a bit hackish but it will avoid extraneous
> > conflicts: first, the library looks for gnome-applications.menu, and
> > falls back to applications.menu if the former doesn't exist. The merged
> > directory is applications-merged in both cases.
>
>  How (or where) was this received upstream?

Upstream is not renaming applications.menu to gnome-applications.menu,
therefore they don't need such a patch. I don't know whether they are
interested in moving to such a scheme.

--
Josselin Mouette                /\./\

"Do you have any more insane proposals for me?"

Reply | Threaded
Open this post in threaded view
|

Re: Debian support for XDG_MENU_PREFIX under GNOME

Vincent Untz
In reply to this post by Josselin Mouette
Replying to old mail...

Le lundi 04 décembre 2006, à 23:07, Josselin Mouette a écrit :
> I've committed all relevant changes (-menus, -panel, bug-buddy, eel2) to
> our SVN.

Did you forward the patch upstream, or is it not useful for upstream? (I
know you usually do so, but I prefer to check :-))

Thanks,

Vincent

--
Les gens heureux ne sont pas pressés.


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Debian support for XDG_MENU_PREFIX under GNOME

Josselin Mouette
Le jeudi 11 janvier 2007 à 16:10 +0100, Vincent Untz a écrit :
> Replying to old mail...
>
> Le lundi 04 décembre 2006, à 23:07, Josselin Mouette a écrit :
> > I've committed all relevant changes (-menus, -panel, bug-buddy, eel2) to
> > our SVN.
>
> Did you forward the patch upstream, or is it not useful for upstream? (I
> know you usually do so, but I prefer to check :-))

The situation around this transition is far from perfect. The patch may
be useful for you GNOME folks, but probably not as is.

First, most distributions will probably want to retain the single menu
structure, as they like to have the same menu for different desktop
environments. Debian has chosen the opposite path: we provide a
different user experience with each desktop environment, and that
includes the menus.

Second, half of the patch is missing: we rename files in the packaging
scripts, and the patch only takes care of handling that renaming when
the menus are requested.

Third, the patch itself is a bit hackish. If the applications-merged
directory wasn't here, we could only prepend the files by "gnome-" and
get done with it. Instead, it has to add "gnome-" for the menus files
known to be renamed, and strip it when looking at the merged directory.
This is the less intrusive way of doing things, but I can think of
better approaches.

Fourth, the patch does not implement the XDG specification, and Debian
never will. Following the XDG specification would imply to set the
XDG_MENU_PREFIX environment variable in gnome-session, and to read this
variable in the gnome-menus library. This directly contradicts with our
policy to not rely on environment variables. The maintainer who did the
menu changes to KDE agreed that this is certainly not the way to go.

Fifth, such a change cannot deal with anything not using gnome-menus.
The most problematic application is alacarte, which uses python-xdg.
Currently, we have patched it to prepend "gnome-" to menus it requests,
but this way it can't handle applications-merged. Fixing it requires an
API extension to python-xdg so that alacarte can set a prefix. The
efforts required go far beyond the interest I have in fixing it...

I guess it all depends on whether enough people are interested in menu
renaming. The best option is probably to do this conditionally with a
configure flag, as forcing other distributions to rename them is not
nice. It should probably not be done until the python-xdg/alacarte
situation is improved.

The one thing I ask is that GNOME goes on with not implementing
freedesktop stuff when it is plain wrong. This has been the case until
now so I'm confident.

Cheers,
--
 .''`.
: :' :      We are debian.org. Lower your prices, surrender your code.
`. `'       We will add your hardware and software distinctiveness to
  `-        our own. Resistance is futile.

Reply | Threaded
Open this post in threaded view
|

Re: Debian support for XDG_MENU_PREFIX under GNOME

Kevin Krammer
On Thursday 11 January 2007 16:57, Josselin Mouette wrote:

> Fourth, the patch does not implement the XDG specification, and Debian
> never will. Following the XDG specification would imply to set the
> XDG_MENU_PREFIX environment variable in gnome-session, and to read this
> variable in the gnome-menus library. This directly contradicts with our
> policy to not rely on environment variables. The maintainer who did the
> menu changes to KDE agreed that this is certainly not the way to go.

Waldo said that it is not strictly necessary to follow the variable if set,
however it is necessary to set it if the session uses a prefix (even a
hardcoded one).

I haven't checked the lastest KDE packages yet, but if they don't already,
they should very likely set the variable to "kde-" in /usr/bin/startkde

Cheers,
Kevin
--
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Debian support for XDG_MENU_PREFIX under GNOME

Ariszló
In reply to this post by Josselin Mouette
On 1/11/07, Josselin Mouette wrote:
> First, most distributions will probably want to retain the single menu
> structure, as they like to have the same menu for different desktop
> environments. Debian has chosen the opposite path: we provide a
> different user experience with each desktop environment, and that
> includes the menus.

Debian has chosen well. Different desktop environments follow
different philosophies. Gnome advocates the one app for one task
philosophy for which a simplified menu structure is optimal. KDE
advocates freedom of choice for which an elaborate menu structure is
required. KDE's submenus would be overpopulated with a Gnome-like menu
structure and the submenus of Gnome's Applications menu would be
underpopulated with a KDE-like menu structure.

Gyula

Gyula (= Julius) Zsigri, aka. Ariszló
http://ariszlo.tripod.com/