s.d
s.d

Reputation: 4185

Eclipse RCP: Key binding for commands work, but shortcuts are not shown in menu

Note: I don't think this is a duplicate of Eclipse Editor plug-in key binding not shown in menu for command!

I have an Eclipse RCP app based on Mars (4.5), which doesn't use any e4 functionality. I have defined my own key scheme, and some key bindings on commands in plugin.xml. They work fine, and when I start my app from the IDE, the menu entries show the shortcut text (e.g., CTRL + Q) in the menu right next to the actual command text, e.g.

Quit CTRL+Q

However, when I build my product (included plugin_customizations.ini) and run it, the key bindings still work, but the actual shortcut text is not shown in the menu anymore.

How can I fix this so that the text is shown in the product build again?

EDIT: This is on Ubuntu 14.04 (Unity).

Started from the IDE, showing the shortcut text:

With shortcut, started from IDE

Started from the built product, same system:

enter image description here

Upvotes: 3

Views: 613

Answers (1)

s.d
s.d

Reputation: 4185

This is an issue with a known bug in Ubuntu (cf. the related Eclipse bug report, discussion on ubuntuforums.org).

To fix this, start the application by setting the UBUNTU_MENUPROXY environment variable to 0. This forces the application to use the menu bar inside the application window instead of the (cursed! cursed! cursed!) Unity global menu.

Unfortunately, there seems to be no way yet to set environment variables on startup (via launcher argument or <application>.ini), but there are two bugs (this one and this one) which request just this, so if you, too, need this, vote them up or take a stab at implementing this...

In the meantime, you can include a custom shell script in the build that users can choose to use for starting the application. This script is very simple:

#/bin/bash
UBUNTU_MENUPROXY=0 ./{your-application-launcher}

If you have a feature-based product, you can also include this script in the build just for products built for Linux. To do so, add the script to the root path of your main feature, and add the following lines to your feature's build.properties.

root.linux.gtk.x86.permissions.755=launcher-unity.sh
root.linux.gtk.x86_64.permissions.755=launcher-unity.sh
root.linux.gtk.x86=file:launcher-unity.sh
root.linux.gtk.x86_64=file:launcher-unity.sh

Upvotes: 1

Related Questions