Community
Participate
Working Groups
When using Eclipse with SWT_GTK3=1, none of the keyboard shortcuts are being displayed for the menu items. Noticed this while testing 4.4 M2 but the behavior is the same with 4.4 M1 as well as 4.3. With GTK+ 2.x, everything works as expected.
Fixed with http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=d60423eb940f186e5cecbc6305de1958854f9bf5.
*** Bug 421837 has been marked as a duplicate of this bug. ***
4.4 M3 still does not show menu shortcut keys...
Which OS are you using. I've noticed that under Ubuntu, Shortcuts are not shown if Eclipse doesn't use the global menu. When it's using global menu, everything is fine. References: * bug 330563 * https://bugs.launchpad.net/ubuntu/+source/appmenu-gtk/+bug/865389 * https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/1208019
(In reply to Mickael Istria from comment #4) > Which OS are you using. > I've noticed that under Ubuntu, Shortcuts are not shown if Eclipse doesn't > use the global menu. When it's using global menu, everything is fine. > References: > * bug 330563 > * https://bugs.launchpad.net/ubuntu/+source/appmenu-gtk/+bug/865389 > * https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/1208019 I'm not sure if it is related to the global menu because I don't see the shortcut keys being shown even on Fedora 17. On both Ubuntu and Fedora, they are shown when running with GTK+ 2 but not when running with GTK+ 3.
Arun, can you please check that you're missing the accelerators in both Eclipse IDE and SWT's ControlExample? For some reason they work in ControlExample but not in Eclispe itself.
(In reply to Alexander Kurtakov from comment #6) > Arun, can you please check that you're missing the accelerators in both > Eclipse IDE and SWT's ControlExample? For some reason they work in > ControlExample but not in Eclispe itself. You are right Alex, the accelerators work with ControlExample and other SWT-only snippets but not in Eclipse's main menu itself. The fix might still need to happen in SWT since the problem appears in Eclipse only when SWT uses GTK 3.
Sure, hopefully we can get some idea what additionally Eclipse does or doesn't do to make accellerators not appear.
> what additionally Eclipse does or doesn't The problem is not only about Eclipse. Context menus are also missing shortcuts in pure SWT 4.4 (master), e.g. in the ControlExample's Menu tab when you right-click "Popup Menu Here". Shortcuts are correctly rendered everywhere in 4.3.1 (Eclipse and ControlExample).
The difference I see in MenuTab is that the one showing accelerators is using Shell.setMenuBar, the other is using Shell.setMenu. This might be a good start for investigation.
Using Eclipse 4.4.M5 with Ubuntu 12.04 (libgtk-3.0 version 3.4.2-0ubuntu5), I can see the shortcuts in main menus but not in context menus.
(In reply to Mickael Istria from comment #11) > Using Eclipse 4.4.M5 with Ubuntu 12.04 (libgtk-3.0 version 3.4.2-0ubuntu5), > I can see the shortcuts in main menus but not in context menus. That sounds weird, I have the exact same versions (4.4 M5 on Ubuntu 12.04) but the shortcuts do not appear for me...
(In reply to Arun Thondapu from comment #12) > (In reply to Mickael Istria from comment #11) > > Using Eclipse 4.4.M5 with Ubuntu 12.04 (libgtk-3.0 version 3.4.2-0ubuntu5), > > I can see the shortcuts in main menus but not in context menus. > > That sounds weird, I have the exact same versions (4.4 M5 on Ubuntu 12.04) > but the shortcuts do not appear for me... Mickael, do you still use the global menu? Has anything changed since your comment 4?
> Mickael, do you still use the global menu? Has anything changed since your > comment 4? Yes, I'm still using global menu. Since comment #4, I've applied all incoming Ubuntu updates (staying on 12.04) and used a newer version of Eclipse. I'm using build 20140130-1145.
(In reply to Mickael Istria from comment #14) > > Mickael, do you still use the global menu? Has anything changed since your > > comment 4? > > Yes, I'm still using global menu. Since comment #4, I've applied all > incoming Ubuntu updates (staying on 12.04) and used a newer version of > Eclipse. > I'm using build 20140130-1145. I just tested with I20140218-0800 and still don't see the shortcuts on the main menu on Ubuntu 12.04.
The patch - https://git.eclipse.org/r/#/c/27247 It requires recompiling libswt-pi3.so because of introducing a new native method.
I have updated the patch. It won't work on GTK3 <3.6. I have tested GTK2, GTK3.4, GTK3.8, GTK3.10 and GTK3.12.
(In reply to Snjezana Peco from comment #17) > I have updated the patch. > It won't work on GTK3 <3.6. > I have tested GTK2, GTK3.4, GTK3.8, GTK3.10 and GTK3.12. Which OS did you test on? I tested the patch on Ubuntu 14.04 and it does not work. This could, however, be specific to Ubuntu Unity's global menu because in Ubuntu 14.04, the accelerators are not appearing even with GTK+ 2.x.
(In reply to Arun Thondapu from comment #18) > Which OS did you test on? I tested the patch on Ubuntu 14.04 and it does not > work. This could, however, be specific to Ubuntu Unity's global menu because > in Ubuntu 14.04, the accelerators are not appearing even with GTK+ 2.x. I have tested the issue on Ubuntu 13.10 with different GTK versions (gtk2, 3.4, 3.8, 3.10 and 3.12). I'm using "UBUNTU_MENUPROXY=" and haven't tested Ubuntu Unity global menu. The issue with Ubuntu Unity global menu is another issue. The code created to fix that issue, in my opinion, isn't correct. It adds GTK accelerators to the menu items. Eclipse doesn't use GTK accelerators, but only GTK accel string. That's way adding them can break some key commands (Alt+Shift+N, for instance). I have tested Eclipse non-Unity menus, Eclipse context menus, ControlExample popup menus ... Everything works correctly with gtk2, gtk3 >= 3.6.
I'm deferring this bug to the SR1 release as we're almost at the end of Luna RC3 but we don't have a comprehensive patch yet which can work with all versions of GTK+ 3.x and on all Linux versions...
I have updated the patch so that menu accelerators are visible on all versions of GTK. There is yet another issue, but it is GTK specific. Accelerators for the radio menu items aren't visible on GTK3 < 3.6. Attached is a test case. The "Ctrl V" accelerator for the Radio1 menu item will be shown on GTK2 and GTK3 >= 3.6, but won't on GTK 3.4.
Created attachment 243745 [details] A test case
I have checked the issue related to the Ubuntu Unity menu. It has been fixed only for GTK2, but the Unity menu requires emitting the "accel-closures-changed" signal. I have updated the patch. I have also attached a patch for the Ubuntu unity-gtk-module project. It fixes the issue for GTK3. Attached is a test case (testubuntu.c). If you run the testubuntu program without the Ubuntu Unity menu (UBUNTU_MENUPROXY= ./testubuntu), the "Set Eclipse accel string" action will change all accelerators. When starting the program with the Ubuntu Unity menu (UBUNTU_MENUPROXY=1 ./testubuntu), the "Set Eclipse accel string" action won't do it. If you apply the patch and run the program with the Ubuntu Unity menu, the "Set Eclipse accel string" action will change the accelerators for the Open and Quit action. The "accel-closures-changed" signal for the Quit action hasn't been called and its accelerator hasn't been changed. The "Set GTK accelerators" action always works because the gtk_widget_add_accelerator method emits "accel-closures-changed". In any case, the Ubuntu Unity menu doesn't show accelerator for a submenu (File>New Shift+Alt+N, for instance). The fix works only on Ubuntu >= 14.04.
Created attachment 244116 [details] A patch
Created attachment 244117 [details] A test case
Pushed to master as http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=5e84f7bd99a883a2b08c1d596f44e1e38be759a1
(In reply to Alexander Kurtakov from comment #26) > Pushed to master as > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=5e84f7bd99a883a2b08c1d596f44e1e38be759a1 Thanks Alexander and Snjezana. Will this be downported to Eclipse 4.4.1?
I would let Arun decide on whether to backport it.
Snejana, would you please provide gerrit patch against R4_4_maintenance so we can get this fixed in Luna SR1?
(In reply to Alexander Kurtakov from comment #28) > I would let Arun decide on whether to backport it. +1 for the backport to 4.4.1.
I have created https://git.eclipse.org/r/30079.
(In reply to Snjezana Peco from comment #31) > I have created https://git.eclipse.org/r/30079. This gerrit request seems to be on the master branch itself. I have cherrypicked the commit to R4_4_maintenance branch and pushed it - http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R4_4_maintenance&id=a02cd0ca0e3604da5a3379d15d27c5bece9684f7
Verified in RC2 and RC3