Eclipse menu bar does not appear in eclipse or the global menu

Bug #688136 reported by iPeel on 2010-12-09
82
This bug affects 16 people
Affects Status Importance Assigned to Milestone
Eclipse
Unknown
Critical
eclipse (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: eclipse

When running Eclipse the global menu just has a File > Close command and the menu bar doesn't appear in Eclipse, thus no menu bar options at all are exposed for Eclipse.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: eclipse (not installed)
ProcVersionSignature: Ubuntu 2.6.37-8.21-generic 2.6.37-rc4
Uname: Linux 2.6.37-8-generic x86_64
Architecture: amd64
Date: Thu Dec 9 16:38:38 2010
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20101202)
ProcEnviron:
 LANG=en_GB.utf8
 SHELL=/bin/bash
SourcePackage: eclipse

Build Identifier: 3.5.2

Hi,

when using Ubuntu Netbook edition with new Unity desktop interface, there are problems with the application menus.

Unity desktop features menu similar to Mac OS X, which is always present on top of the desktop. When I run my application (using pure SWT, no JFace) on Unity desktop, menu is not present inside application window and neither in the OS menu bar.

This problem will get even worse once Canonical includes this desktop-wide menu in standard desktop edition of Ubuntu (scheduled for the 11.04 release).

I would like to know if there are any plans for SWT to support new menu with Unity.

Best regards,

Albert

Reproducible: Always

Steps to Reproduce:
Create a shell and add menu to it. Run application on Ubuntu Netbook edition with Unity UI -> Application's menu is not present.

Created attachment 185320
Screenshot of Eclipse 3.6.1 on Ubuntu netbook edition

Yes, the problem unfortunately is present on 3.6.1 too. I installed eclipse 3.6.1 and only "File" menu is present, with single "Close" item. I'm attaching a screenshot.

lolikandr (lolikandr) wrote :

I have my Ubuntu updated to Natty at 19 Dec 2010.
Architecture: x386
uname -a: Linux xxx-laptop 2.6.37-10-generic-pae #24-Ubuntu SMP Thu Dec 16 19:11:17 UTC 2010 i686 GNU/Linux

The current version of the Eclipse EE ide also hase problems with the Menu bug. Only when you log out, and login with the normal Desktop shell the menu appears but its gone when you login with the netbook shell.

Please, make sure that eclipse renders the menu correctly on Ubuntu's AppMenu (the global menu), as more and more software development companies and individuals rely on Ubuntu to develop using Eclipse, and it will be a huge impact from April, where Ubuntu's stable version will not render Eclipse's menus...
There is a workaround reported in https://bugs.launchpad.net/appmenu-gtk/+bug/613119/comments/8 but this is not a real solution.
Thanks.

Issuing export UBUNTU_MENUPROXY=0 command before running Eclipse makes menus appear inside the application window, while global menu still hosts just a "File" menu with single "Close" item.

Took a look at this today with the guys who are implementing the application menubar for Unity, and at first glance, it doesn't seem to be a problem on our end. (i.e. the code that we are using to create menus in SWT should work).

Will update when I have more info.

I was looking into this a bit today. It appears that the appmenu gtk module never hears the "realize" event from SWT widgets. Does that sound expected? It looks like gtk_realize is a bit of a stub in Widget.java, but not sure if that's normal.

Blazej Ksycki (xyc) on 2011-02-01
Changed in eclipse (Ubuntu):
status: New → Confirmed

(In reply to comment #8)
> I was looking into this a bit today. It appears that the appmenu gtk module
> never hears the "realize" event from SWT widgets. Does that sound expected?
> It looks like gtk_realize is a bit of a stub in Widget.java, but not sure if
> that's normal.

Also, you cannot right-click and pin the Eclipse icon to the sidebar. Is this related?

(In reply to comment #8)
> I was looking into this a bit today. It appears that the appmenu gtk module
> never hears the "realize" event from SWT widgets. Does that sound expected?
> It looks like gtk_realize is a bit of a stub in Widget.java, but not sure if
> that's normal.

Other SWT based applications are now fixed (like TuxGuitar), but Eclipse is not.

It looks like that Eclipse is doing something wrong...

For more information, see: https://bugs.launchpad.net/ubuntu/+source/libdbusmenu/+bug/618587/comments/16

iPeel (ubuntu-peely) wrote :

Still exists in Natty Alpha 2. Makes Eclipse a non-option in Natty until fixed.

Let me know if you need any further traces etc.

Thanks,

Neil.

Sorry for insisting on this issue.
I know I'm not helping with code (nor I could, as I know nothing on GTK), and I don't want to be a boring guy but I really think that it would be too bad for both Ubuntu and Eclipse (2 technologies I love) if this issue is not sorted out when Natty launches.
Also, Eclipse 3.6 didn't made into Natty's repository (I think it will continue with 3.5 for this cycle). The packaged version includes an environment variable on the launcher to disable the global menu, which at least makes Eclipse usable.
However, anyone needing a newer version of eclipse will download, and, when running, will see no menu at all.
So, if possible, please, backport the fix to eclipse 3.6.

No worries on the environment variable issue. As of now, appmenu-gtk blacklists Eclipse. This has two benefits: (1) apps launched by eclipse aren't blacklisted and (2) no matter where the user gets Eclipse from, it will not have broken menus.

Still, it would be nice to fix.

iPeel (ubuntu-peely) wrote :

Appears tio be fixed in Alpha 3, a non-global menu bar is fully present in the Eclipse window.

note this is tested in Helios (Ecluipse 3.6 2011-02-18) obtained directly from eclipse.org.

Changed in eclipse (Ubuntu):
status: Confirmed → Fix Released
Günter (guenter-grodotzki) wrote :

Unfortunately the problem exists with Aptana Studio 3 (latest beta)

danielfs1 (danielfs1) wrote :

I can confirm that the menu bar doesn't work with Aptana Studio 3 Beta (Using Desktop x86 Beta1 11.04)

tanktarta (tanktarta) wrote :

The same problem exists with SpringSource Tool Suite
Version: 2.6.0.RELEASE - based on Eclipse 3.6. However, vanilla Eclipse (3.6) seems fine.

Niels Thykier (niels-thykier) wrote :

Hi

I think you need to file a bug against the unity menu for these applications (unfortunately the package name eludes me at the moment). Currently eclipse (incl. vanilla Eclipse) has an exception in the menu, but all this eclipse-derived applications probably do not.

As a temporary work around it should work to set the environment variable "UBUNTU_MENUPROXY" to 0 (and export it), but it will affect all applications launched by this program as well (this is the reason eclipse got its exception). From a normal bash terminal this can be done with:

 $ export UBUNTU_MENUPROXY=0
 $ /path/to/application

~Niels

It seems that bug still appears in Ubuntu Natty. I just upgrade Ubuntu some hours ago... and this bug is very annoying.

One think that I have to notice that I have only menu "Window" but others, doesn't appear.

Is someone trying to fix this?

With regards
Kamil Gałuszka

This is a problem for RCP apps based on Eclipse.

I tried our RCP application on Ubuntu 11.04 with Eclipse 3.6.2 and 3.7 M7 (http://archi.cetis.ac.uk/). No main menus available in Unity mode. Also tried some other RCP apps - XMind, RSSOwl. Same thing.

Only thing I could do was provide a shell script to launch the app:

#!/bin/bash
export UBUNTU_MENUPROXY=0
./App_Name

Is this a fault of Eclipse or of Ubuntu?

It seems that the initial realize problem was fixed (where Unity was listening for gtk_realize to get the menu items).

If Eclipse is still having problems with menus, it could be because Eclipse creates some menus dynamically when they are needed. (If this is the case, we still believe it's a problem in Unity - some applications need dynamic menus).

We'll get the latest Ubuntu and investigate.

Unity's appmenu code listens for the map event to read in all of the menu items to add to the top menu bar. Applications that have dynamic menus are not supported. This support could be added by Unity by listening for the add/remove signal on the menu bar and rebuilding the top bar whenever the listeners get called.

Eclipse itself runs under Ubuntu 11.04 with the menus intact in its shell. This works because an exception has been made in the appmenu code for Eclipse. An RCP app will have its menus added to the top menu bar, but any adding/removing of menu items by the app will fail.

Created attachment 194654
Sample snippet

Here is a sample snippet that shows dynamic menus failing. When you run the snippet, you will get a shell with a button in it. The top menu bar will have File and Edit menus visible. If you press the button, a new menu item gets added to the the menu bar, but the top bar does not get updated.

If you uncomment the "OS.g_set_prgname(buffer);" line, it will force the menu bars to appear in the shell. Clicking on the button, you will see that the menu item gets added to the bar.

I experience the same problem in Kubuntu 11.04 (KDE 4.6.2).
There is a Window Menubar Widget which adds the same Mac-OS-like menu style as in Unity. It most likely has the same root, but I'm not sure.
Here is are some details on the widget http://agateau.wordpress.com/2010/05/10/getting-menus-out-of-application-windows/

Kojo Gambrah (kgambrah) wrote :

In SpringSource Tool Suite, resetting the perspective fixes the problem until the IDE is restarted.

(In reply to comment #16)
>...An RCP app will have its menus added to the top menu bar, but any adding/removing of menu items by the app will fail.

Not so with our RCP application. We create our menu items in an ActionBarAdvisor class. Is this deemed to be "adding/removing of menu items by the app"?

RCP apps will have their menus fixed in Ubuntu by a patch I've made to libdbusmenu [1]. This will hopefully get backported to Ubuntu 11.04.

However! There is one issue with global menu support that I just can't seem to fix from outside of RCP itself. The issue is keyboard shortcut labels on menu items. Right now, it's a bit hit or miss whether they show up.

RCP has two MenuItem accelerator-related methods. It can call setAccelerator on the menu item which installs the key codes themselves and tells GTK+ about it. This we can detect and show correctly.

The other method is to just set the text itself on the menu item and RCP seems to handle the key press itself elsewhere. So all GTK+ knows about is that there is (possibly translated) text representing the shortcut in the label.

Is there a way to get RCP to also use setAccelerator whenever it sets shortcut labels? That would ensure that menu items work correctly.

[1] https://code.launchpad.net/~mterry/dbusmenu/eclipse-rcp

(In reply to comment #20)
> Is there a way to get RCP to also use setAccelerator whenever it sets shortcut
> labels? That would ensure that menu items work correctly.

RCP and Eclipse SDK use a KeyDown filter to process key shortcuts. We have multi-keystroke shortcuts and shortcuts for behaviour not in the menus directly.

But even for some more standard accelerators (CTRL+Y or ALT+/) the system has to dispatch to a handler based on a number of factors, including which part is active, what's the selection, etc. Using setAccelerator(*) would fire the Selection for that MenuItem, producing the wrong executing in about half of the Eclipse SDK cases.

PW

workaround solves the menu doesn't appear part, but does not solve the menu doesn't appear in Ubuntu Unity's global menu part. Please get global menu working so that I can save some screen real-estate in my tiny netbook, thanks!

I have noticed the following:

When I run normal Eclipse on 12.04 Alpha, menu appears as traditional.
When I run an Eclipse org.eclipse.platform.ide *product* menu appears as traditiona.

But if I run org.eclipse.ui.ide.application *application* then menu behaves in line with Unity Desktop - appearing at top bar.

I think that makes a difference.

Regards,
Hasan Ceylan

Changed in eclipse-eclipsers:
importance: Unknown → Critical
status: Unknown → Confirmed

Running ubuntu 11.10, unity 2d and eclipse 3.7, I found that the f10 key does not activate the menu.

For those who are affected with this bug, the dirty hack is to remove the product from config.ini .

The downside I could see is that
- you loose the progress baron the splash and the product
- About Dialog looks ugly with the product image and product description missing.

There may be some complications, I'll try to test and report if I find a show stopper.

Regards,
Hasan Ceylan

Guys, is this a joke? This bug was reported around 1.5 years ago and still no one was able to fix it?

Are you kidding me, that in 1.5 years the very best idea is to hack my system files with vim?

That's plain ridiculous...

(In reply to comment #26)
> Guys, is this a joke? This bug was reported around 1.5 years ago and still no
> one was able to fix it?
>
> Are you kidding me, that in 1.5 years the very best idea is to hack my system
> files with vim?
>
> That's plain ridiculous...

You know that this is open source, right? Who do you think should step in and fix it?
I would say someone that cares about Unity.

Hi Alexander,

Yes, I know it's an open source one, and I realize that this is the death of the open source world: pointing at each other all the time. If you report a bug at Unity/Ubuntu, they point at this bug report. If you report it here, you say it's their fault, they should fix it!

See, my point is: from my perspective, I don't give a flying damn who's fault is it. It's a bug that has been reported and confirmed for 1.5 years.

It's so sad to see that all those talented people who are willing to contribute their efforts to these projects just want to create another 'world changing' project instead of solving the problems right here. Why bother with Netbeans, let's fix Eclipse. Oh, Eclipse got problems too, let's deal with jEdit. Oh, jEdit sucks too, let's...

I wish you'd charge $5 for every open source project. I wish you'd support it. I wish I could rely on you and your supported project.

I simply do not need 15 faulty Java IDEs. Nor need many version of Java runtime. I need one, that works and that is more than enough!

But now, what choices do I have? I have to opt out from Ubuntu as it's got severe, unresolved, "it's not my fault" type of bugs. Should I buy Apple? Oh, well, JDK 1.7 is not fully supported. Moving forward... Guess which platform is fully supported?

Anyway, please don't tell me that it has been hard for any Eclipse devs/architects to chase down a Ubuntu dev/architect while having a beer: hey, we need to fix it! Oh, well, I'll do it, it takes only 15 minutes or, whatever...

Or if this conversation is impossible, I'd strongly suggest abandoning any open source projects and supporting only licensed ones - they can and do have these type of conversations to support us, me, the user.

And BTW: thank you Alexander for your time and effort supporting open source projects!

(In reply to comment #28)
> Hi Alexander,
>
> Yes, I know it's an open source one, and I realize that this is the death of
> the open source world: pointing at each other all the time. If you report a bug
> at Unity/Ubuntu, they point at this bug report. If you report it here, you say
> it's their fault, they should fix it!
>
> See, my point is: from my perspective, I don't give a flying damn who's fault
> is it. It's a bug that has been reported and confirmed for 1.5 years.
>
> It's so sad to see that all those talented people who are willing to contribute
> their efforts to these projects just want to create another 'world changing'
> project instead of solving the problems right here. Why bother with Netbeans,
> let's fix Eclipse. Oh, Eclipse got problems too, let's deal with jEdit. Oh,
> jEdit sucks too, let's...

I feel your pain. It's even worse when you have to deal with the libraries this applications use.

>
> I wish you'd charge $5 for every open source project. I wish you'd support it.
> I wish I could rely on you and your supported project.

Well, there are a number of supported Eclipse variations. If you contact me offlist I would point you to few. But having support means that there are a number of limitations enforced to the users as noone can support every possible combination and it looks like noone has a paid supports for Eclipse on Unity as there are no fixes.

>
> I simply do not need 15 faulty Java IDEs. Nor need many version of Java
> runtime. I need one, that works and that is more than enough!
>
> But now, what choices do I have? I have to opt out from Ubuntu as it's got
> severe, unresolved, "it's not my fault" type of bugs. Should I buy Apple? Oh,
> well, JDK 1.7 is not fully supported. Moving forward... Guess which platform is
> fully supported?

Well, a bit of googling will help you find a what of interesting info about who is working on what so you can make an informed decision about choosing the distribution.

>
> Anyway, please don't tell me that it has been hard for any Eclipse
> devs/architects to chase down a Ubuntu dev/architect while having a beer: hey,
> we need to fix it! Oh, well, I'll do it, it takes only 15 minutes or,
> whatever...

This is the point, there are always more things to fix/improve than installing a new OS to try reproducing a problem you don't see on yours. This is not a 15 minutes for me.
>
> Or if this conversation is impossible, I'd strongly suggest abandoning any open
> source projects and supporting only licensed ones - they can and do have these
> type of conversations to support us, me, the user.

The conversation is possible but every such conversation needs at least one interested party. And as can be seen from the bug report no Eclipse developers seems to care about Unity nor Unity devs care about Eclipse. If there was someone intereseted it would have been fixed long ago and it will stay this way until such an interested person appears.

>
> And BTW: thank you Alexander for your time and effort supporting open source
> projects!
Thanks for these words.

For now, it seems that the problem is in libdbusmenu (Unity side).
Eclipse is blacklisted in a binary file in libdbusmenu, so the menu is always on the application. There is no friendly way to remove it from the blacklist, but there is a workaround which involves editing the binary file here: https://bugs.launchpad.net/ubuntu/+source/libdbusmenu/+bug/618587/comments/46
I've reported https://bugs.launchpad.net/ubuntu/+source/libdbusmenu/+bug/890294 to remove Eclipse from the blacklist, but no one did it so far.
I think the best way to help here is to test the workaround with all menu functions and insist on that last bug report I've mentioned, maybe even sending a patch for it (I think it should be an one-liner).

Adam,

What you say is true not only for open source projects, but also closed source / paid applications, even you can make the same argument for your car.

On the other hand eclipse is there, every missing part is an opportunity to make some money, if you think all IDEs sucks including eclipse pick the best open source one you like and fork it, and get rich over people like you.

There are always urgency and importance in every job. For some time eclipse devs have been working hard to prepare eclipse 4.0, which is just around the corner.

On the other hand if you spent the time to read the comments you spent on writing the message, you would find that I proposed a simple workaround for now. Just remove the application and run it as application.

Last but not the least, rather then storming like this, you go in fix it and you're done. If you cannot you still can hire someone to fix unity and / or eclipse together and give back.

That is the spirit people wants to keep here not yours.

One can get this to work.

This seems to work correctly on my set up (I am using Kubuntu 12.04 with the KDE version of appmenu (which uses the same library as Unity as far as I know).

After a clean install for Eclipse 3.8, this does not work, but after changing the eclipse.ini to my default settings, it started working. Unfortunately, I do now know which setting fixes the issue.

Here is my Eclipse.ini:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120522-1813
-vm
/home/fwi/Applications/java/jdk7_01-x64/jdk1.7.0_01/bin/java
-product
org.eclipse.epp.package.jee.product
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-pluginCustomization
/home/fwi/Workspace/defaults-1.epf
--launcher.XXMaxPermSize
1024m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms3G
-Xmx3G
-XX:+UnlockExperimentalVMOptions
-XX:PermSize=512m
-XX:MaxPermSize=1024m
-XX:MaxHeapFreeRatio=70
-XX:+CMSIncrementalPacing
-XX:+UseG1GC
-XX:+UseFastAccessorMethods
-XX:ParallelGCThreads=2
-Dcom.sun.management.jmxremote
-Xverify:none

 https://bugs.launchpad.net/ubuntu/+source/libdbusmenu/+bug/618587/comments/46

this work just fine in 12.04 LTS with eclipse 3.7

(In reply to comment #33)
> One can get this to work.

Beware: Expect some weirdness if you start Eclipse with a product that cannot be found, e.g.:

-product
no.valid.product

Some key bindings don't work (Navigate > Show In, Alt+Shift+W), and these messages on the console also don't look promising:

(SWT:25413): LIBDBUSMENU-GTK-CRITICAL **: watch_submenu: assertion `GTK_IS_MENU_SHELL(menu)' failed

This issue is definitely not an Eclipse one, but an Ubuntu one. Ubuntu hardcoded an exception for Eclipse menu in there menu manager.
This exception can be removed on the Ubuntu side by tweak linked earlier by Luis Fernando: https://bugs.launchpad.net/ubuntu/+source/libdbusmenu/+bug/618587/comments/46 It's working correctly as far as I've used Eclipse for the last few days.

Also note that Ubuntu menu are used for other RCP applications that are not titled "Eclipse".

For further better integration of Eclipse into Ubuntu, follow this Ubuntu ticket: https://bugs.launchpad.net/ubuntu/+source/appmenu-gtk/+bug/865389 and help it to get merged into Ubuntu.

If some error specific to Eclipse happen in Ubuntu after this ticket is fixed, or with already existing other RCP applications, then please open other tickets specific to these issues.

Is this issue expected to be fixed on Ubuntu 12.04?
I'm trying the most recent I build from eclipse 4.3 and I'm still getting the same error.

ok, after all it seems to work. Yet I still get a bunch of errors in my log.

Changed in eclipse-eclipsers:
status: Confirmed → Unknown

(In reply to comment #34)
> Some key bindings don't work (Navigate > Show In, Alt+Shift+W), and these
> messages on the console also don't look promising:
>
> (SWT:25413): LIBDBUSMENU-GTK-CRITICAL **: watch_submenu: assertion
> `GTK_IS_MENU_SHELL(menu)' failed

I also see lots of those assertions, and none of the icons appear in any menu (regardless of whether I use the "appmenu" global menu or not).

Does anybody have information about these issues, ie how to get Eclipse to work perfectly well on Ubuntu ?

Yes another Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/1208019
It looks like the Ubuntu global menu is too buggy/limited to play nicely with Eclipse in some circumstances. So the workaround is to not use it.
However, this will cause an issue with GTK3 implementation in Ubuntu: bug 417601

Ubuntu is definitely not standard-friendly enough to guarantee perfect integration with Eclipse.

Now tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=419830.

The "env UBUNTU_MENUPROXY=0 ./eclipse" from above is a viable short-term work-around.

(In reply to Paul Webster from comment #21)
> (In reply to comment #20)
> > Is there a way to get RCP to also use setAccelerator whenever it sets shortcut
> > labels? That would ensure that menu items work correctly.
>
> RCP and Eclipse SDK use a KeyDown filter to process key shortcuts. We have
> multi-keystroke shortcuts and shortcuts for behaviour not in the menus
> directly.
>
> But even for some more standard accelerators (CTRL+Y or ALT+/) the system
> has to dispatch to a handler based on a number of factors, including which
> part is active, what's the selection, etc. Using setAccelerator(*) would
> fire the Selection for that MenuItem, producing the wrong executing in about
> half of the Eclipse SDK cases.

what is a practical solution to make a global menu work then?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.