Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 256614 - gnome-base/gnome-menus / kde-base/kdelibs-4.1.4 - /etc/xdg/menus/applications.menu collision
Summary: gnome-base/gnome-menus / kde-base/kdelibs-4.1.4 - /etc/xdg/menus/applications...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
: 275101 349208 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-28 11:42 UTC by Pacho Ramos
Modified: 2011-01-23 14:40 UTC (History)
13 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2009-01-28 11:42:29 UTC
/etc/xdg/menus/applications.menu is being provided by both, causing to get messed menus under gnome just after merging kdelibs (and running dispatch-conf).

There seems to be some possible solutions for this:
1. Patching kdelibs for using, for example, kde4-applications.menu instead of applications.menu (this is the way chosen by debian, look at http://patch-tracking.debian.net/patch/series/view/kde4libs/4:4.2.0-2/11_default_kde4_xdg_menu_prefix.diff , and also chosen by fedora, look at ftp://ftp.free.fr/pub/Distributions_Linux/Fedora/development/source/SRPMS/kdelibs-4.2.0-4.fc11.src.rpm :

# see also use-of/patching of XDG_MENU_PREFIX in kdebase/kde-settings
mv %{buildroot}%{_kde4_sysconfdir}/xdg/menus/applications.menu \
   %{buildroot}%{_kde4_sysconfdir}/xdg/menus/kde4-applications.menu

3. Move both, creating kde and gnome subdirs under /etc/xdg/menus (this is the mandriva's way:
ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/devel/cooker/SRPMS/main/release/kdelibs4-4.2.0-2mdv2009.1.src.rpm
ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/devel/cooker/SRPMS/main/release/gnome-menus-2.25.5-4mdv2009.1.src.rpm

But I don't know which one would be better :-/

Thanks a lot :-)

2. Move gnome-menus provided file to something like gnome-applications.menu (this is the opensuse's way:
http://download.opensuse.org/factory/repo/src-oss/suse/src/gnome-menus-2.24.1-3.15.src.rpm

# Rename applications.menu to not collide with other desktops:
mv $RPM_BUILD_ROOT/%{_sysconfdir}/xdg/menus/applications.menu $RPM_BUILD_ROOT/%{_sysconfdir}/xdg/menus/gnome-applications.menu



Reproducible: Always
Comment 1 Pacho Ramos gentoo-dev 2009-01-28 11:45:10 UTC
Ups, I accidentally moved the text just before sending causing "2. ..." to be at end of report :-S
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2009-01-29 20:10:21 UTC
OMG, maybe GNOME and KDE should block each other. :)
Comment 3 Daniel Gryniewicz (RETIRED) gentoo-dev 2009-02-24 16:20:09 UTC
Nah, just remove KDE from the tree... :P
Comment 4 Tomáš Chvátal (RETIRED) gentoo-dev 2009-02-24 16:39:04 UTC
Actualy find me brave person that will install kde and gnome on one pc :P
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2009-02-25 06:30:06 UTC
(In reply to comment #3)
> Nah, just remove KDE from the tree... :P

In the spirit of equality, why not remove both? *wink* *wink*, *nudge*, *nudge*
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2009-02-25 06:32:52 UTC
(In reply to comment #4)
> Actualy find me brave person that will install kde and gnome on one pc :P

Bought the T-shirt.
Comment 7 Nirbheek Chauhan (RETIRED) gentoo-dev 2009-02-25 14:09:56 UTC
(In reply to comment #3)
> Nah, just remove KDE from the tree... :P
> 

CCing tree-cleaners... *g*
Comment 8 Rémi Cardona (RETIRED) gentoo-dev 2009-02-25 14:22:37 UTC
Nirbheek, nice but let's not get this go too far shall we? :)

@treecleaners, sorry for the noise. The new guy will be properly reprimanded.

Cheers
Comment 9 Jorge Manuel B. S. Vicetto Gentoo Infrastructure gentoo-dev 2009-02-25 15:19:19 UTC
(In reply to comment #7)
> (In reply to comment #3)
> > Nah, just remove KDE from the tree... :P
> > 
> 
> CCing tree-cleaners... *g*
> 

Oh my, I see I'm going to have some forced "vacations" ;-)

Thanks Pacho for the bug report and for listing all these alternatives. In my view, from the above, creating subdirs for GNOME and KDE would probably be the best option. Unless we can have a unified file, both DEs respect the existing file and don't trash the other DE entries and if it even makes sense to do it.

PS - Any chance of XFCE or some other DE joining this "fun" later? cc'ing XFCE just in case.
Comment 10 Jeremy Olexa (darkside) (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2009-02-25 15:26:31 UTC
(In reply to comment #9)

> PS - Any chance of XFCE or some other DE joining this "fun" later? cc'ing XFCE
> just in case.

Current xfce doesn't provide /etc/xdg/menus/ ;) 

%% ls /etc/xdg/                                           
Thunar/  autostart/  xfce4/  xfce4-session/

We don't need the noise of this bug, so I'm going to remove us.
Comment 11 Alexandre Rostovtsev (RETIRED) gentoo-dev 2009-02-27 03:36:46 UTC
(In reply to comment #4)
> Actualy find me brave person that will install kde and gnome on one pc :P

I did. Works nicely after applying the Debian kdelibs patch that Pacho Ramos linked to.

Installing Gnome and KDE together is a perfectly reasonable thing to do if you love a few KDE applications (Konqueror, Kate) but find the overall KDE desktop to be spectacularly unusable.
Comment 12 Maciej Mrozowski gentoo-dev 2009-04-01 23:24:27 UTC
The correct way of doing it would be[1] :
rename applications.menu to gnome-applications.menu
export XDG_MENU_PREFIX="gnome-" in gnome session startup script
install file in /etc/xdg/menus/

for kde4
rename applications.menu to kde-${SLOT}-applications.menu
export XDG_MENU_PREFIX="kde-${SLOT}-" in startkde
install file in /etc/xdg/menus/

DE sessions will pick their own application menu definitions.

1. http://standards.freedesktop.org/menu-spec/menu-spec-latest.html (File locations, 6th paragraph)
Comment 13 Maciej Mrozowski gentoo-dev 2009-04-02 02:53:32 UTC
errata - for KDE of course use prefixed sysconf install dir (/etc for -kdeprefix, /usr/kde/slot/etc for kdeprefix)

Fixed in kde-testing (dropped-kdeprefix-on-non-kde-base branch), will enter tree along with 4.2.2.
Comment 14 runoverheads 2009-06-16 21:49:04 UTC
Fixed in kde-testing, >kde4.2.2?
that XDG_MENU_PREFIX=@REPLACE_MENU_PREFIX@=kde-${SLOT}- ?
but i don't use kdeprefix USE flag and then menu file path '/etc/xdg/menus/kde-${SLOT}-applications.menu' doesn't need for me. i think it's file path mast be '/etc/xdg/menus/kde-applications.menu' and XDG_MENU_PREFIX mast be 'kde-'.

see http://bugs.gentoo.org/show_bug.cgi?id=267793
Comment 15 Tomáš Chvátal (RETIRED) gentoo-dev 2009-06-16 21:57:29 UTC
We know it is fixed on kde side, but what about gnomies. :]
Comment 16 Maciej Mrozowski gentoo-dev 2009-06-16 23:33:12 UTC
Imho, every DE that makes use of any applications.menu in XDG_CONFIG_DIRS location, should install that file prefixed if it provides one (and setting appropriate XDG_MENU_PREFIX within its session).
This ensures no more collisions in a future and also ensures that the one installed is an effective one.
Comment 17 Nirbheek Chauhan (RETIRED) gentoo-dev 2009-07-07 11:03:28 UTC
*** Bug 275101 has been marked as a duplicate of this bug. ***
Comment 18 Gilles Dartiguelongue gentoo-dev 2009-07-26 21:04:44 UTC
Setting this in /etc/X11/Sessions/Gnome doesn't work for gdm 2.26 as it is using the more modern /usr/share/xsessions/ files. Setting this in /etc/X11/gdm/Xsession is non-sense because users could use gdm to log into kde or xfce or a custom session.

However, it seems modern session manager export what session has been selected by setting DESKTOP_SESSION as ${session%.desktop}. old gdm (<2.24) also does this export but based older filename in other locations. It basically results in DESKTOP_SESSION value being either:
 gnome, kde{-4,-4.2,...}, xfce (possible with version), custom or default.

I propose that DEs drop a little file in /etc/X11/xinit/xinitrc.d/10-xdg-menu-$de that basically contains the following:

#!/bin/sh

if [ -z "$XDG_MENU_PREFIX" ] && [ "$DESKTOP_SESSION" = "$de" ]
then
	export XDG_MENU_PREFIX=$de-
fi

Users starting their DE's by hand would have to set this variable to get their menus but that doesn't sound too bad. It is that or making hacky stuff in gnome-session which will probably confuse users with upgrading.
Comment 19 Gilles Dartiguelongue gentoo-dev 2009-07-26 21:48:27 UTC
fixed in gnome-menus-2.26.2. Thanks for reporting.
Comment 20 Xake 2009-07-27 07:13:32 UTC
This fix broke for me not using a DM.

I login in on a TTY and run startx (this is becouse of unrelated lockup problems after loggin in with the help of gdm) but this seems to give me a empty menu since nothing sets DESKTOP_SESSION to "gnome"...

Is the proper fix for this setting DESKTOP_SESSION like XSESSION in /etc/env.d (using openrc)?
Comment 21 Hans Nieser 2009-07-27 07:28:25 UTC
I also ran into this problem since I use SLiM (a login manager), and had not set this variable. Not that I mind having to set it, but maybe /etc/X11/Sessions/Gnome should set this DESKTOP_SESSION to gnome by default?
Comment 22 Rémi Cardona (RETIRED) gentoo-dev 2009-07-28 07:47:23 UTC
broke metisse for me here and setting DESKTOP_SESSION="gnome" didn't fix it. Now I know metisse isn't even in portage but this is getting out of hand.

Are we actually guessing how to fix those things? </rant>
Comment 23 Rémi Cardona (RETIRED) gentoo-dev 2009-07-28 07:53:59 UTC
Ok, so DESKTOP_SESSION needs to be set before xinitrc.d is sourced...

Sigh, this is not getting simpler :)
Comment 24 Rémi Cardona (RETIRED) gentoo-dev 2009-07-28 08:49:00 UTC
Meh :)
Comment 25 Marti Raudsepp 2009-08-01 23:12:19 UTC
So where is it documented how to set the DESKTOP_SESSION variable when launching your DE from within ~/.xinitrc? I thought this was an acceptable way of running the DE, per http://www.gentoo.org/doc/en/gnome-config.xml#doc_chap2_sect2

The /etc/X11/xinit/xinitrc.d/10-xdg-menu-gnome file exists with its expected content.
My ~/.xinitrc now contains:
    #!/bin/sh
    export DESKTOP_SESSION=gnome
    exec gnome-session

But my Applications menu is still empty and XDG_MENU_PREFIX is still unset when I run startx.
Comment 26 David Abbott gentoo-dev 2009-08-02 00:09:54 UTC
See bug 279555 for gnome-base/gnome-menus-2.26.2
Comment 27 Steffen Schaumburg 2009-08-28 22:32:08 UTC
I think this might help:

 * Messages for package gnome-base/gnome-menus-2.26.2:
 * Due to bug #256614, you might loose icons in applications menus.
 * If you use a login manager, please re-select your session.
 * If you use startx and have no .xinitrc, just export XSESSION=Gnome.
 * If you use startx and have .xinitrc, export XDG_MENU_PREFIX=gnome-.

Haven't tried it since I use gdm but thought I'd let you know :)
Comment 29 solar (RETIRED) gentoo-dev 2010-03-27 01:36:00 UTC
This bug bugs me.
Comment 30 yardbird 2010-07-10 22:43:29 UTC
(In reply to comment #29)
> This bug bugs me.
> 

Any idea on how to fix this when using NX/Neatx? I have installed both KDE and Gnome on a remote server and on KDE, menu is fine, under Gnome it is completely empty.

I've tried some of the posted solutions, but none seems to work so far.
Comment 31 yardbird 2010-07-14 12:29:57 UTC
(In reply to comment #30)
> (In reply to comment #29)
> > This bug bugs me.
> > 
> 
> Any idea on how to fix this when using NX/Neatx? I have installed both KDE and
> Gnome on a remote server and on KDE, menu is fine, under Gnome it is completely
> empty.
> 
> I've tried some of the posted solutions, but none seems to work so far.
> 

OK, disregard that... Just using a script that sets those env variables and then launches gnome-session did work. Still, it would be nice if this issue was handled automatically.
Comment 32 Raúl Porcel (RETIRED) gentoo-dev 2011-01-23 14:40:04 UTC
*** Bug 349208 has been marked as a duplicate of this bug. ***