Bug 570722 - [win32] Menu "&Se&arch" does not respond to underlined shortcut Alt+A
Summary: [win32] Menu "&Se&arch" does not respond to underlined shortcut Alt+A
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.18   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-28 11:56 EST by Gernot Hüller CLA
Modified: 2021-02-15 05:04 EST (History)
6 users (show)

See Also:


Attachments
SWT snippet to test the behavior (728 bytes, application/octet-stream)
2021-02-13 05:26 EST, Rolf Theunissen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gernot Hüller CLA 2021-01-28 11:56:40 EST
I am using menu shortcut combinations a lot and this one now does no longer work.
It did work correctly in Eclipse 2020-03 which was the last one I used befire Eclipse 2020-12 on Windows 10.

It seems that the letter "a" from "Search" is _displayed_ as underlined but windows does not use it as a shortcut.
Instead, it uses the first letter "S". You can quickly verify that by pressing Alt+S and the Search menu opens.

However, that is not a solution because the Alt+S shortcut belongs to the "Source" menu. And of course the underlined letter does not match the actual behaviour.

Using the non-first letter as keyboard shortcut is not completely broken, as Alt+T still opens the "Refactor" (Refac&tor) menu.

Note that I am talking about the platform behaviour (unless it is cleverly emulated in Eclipse)
Comment 1 Thomas Schindl CLA 2021-01-29 07:05:30 EST
Just to make sure we talk about mnemonics and not shortcuts.
Comment 2 Wim Jongman CLA 2021-01-29 08:23:15 EST
(In reply to Gernot Hüller from comment #0)

Gernot, I do not have this issue. alt-a gives me the search menu.

Did you install additional plugins? If so can you do:

ctrl+3 -> "copy config data to clipboard" -> paste in file -> attach

Also, can you try window/new window and test if the behavior is different?
Comment 3 Gernot Hüller CLA 2021-01-29 11:33:26 EST
I found the culprit!
After your hint about installed plugins, I looked what I did and performed a few more installs from scratch.
It is true, Eclipse IDE by itself works fine, even in the flavour "for Enterprise Java Developers".
However, when I add stuff from JBoss after installation, the problem begins. (And it also remedies when I uninstall everything jboss)
I do not know which exact plugin it is, but when I install the "JBoss Web and Java EE Development" option, trouble begins.

So of course this eclipse IDE bug should be closed and I will write the JBoss colleagues.
I dont know if it is legit if I myself edit the state of this ticket, so I kindly ask someone else to close it.
Comment 4 Gernot Hüller CLA 2021-01-29 12:02:59 EST
reported to jboss tools as https://issues.redhat.com/browse/JBIDE-27641
Comment 5 Lars Vogel CLA 2021-01-29 12:06:00 EST
Thanks for the feedback
Comment 6 Rolf Theunissen CLA 2021-02-08 09:14:07 EST
After installing the JBoss tooling the search menu is defined as "&Se&earch", that is, with two mnemonics. This is by itself tricky, and no clue what the effect on the other platforms is. That should be fixed in JBoss

The second mnemonic is showed as underlined, however only the first mnemonic opens the menu. This is a SWT (or even win32) bug.
Comment 7 Rolf Theunissen CLA 2021-02-09 02:55:05 EST
I can confirm that this is a Windows bug, I can reproduce it with plain win32 API. When a menu item is created with multiple ampersands, the first one is used as access key, while the last one is underlined.

A workaround would be to filter the strings to only accept one ampersand.

How do other platforms handle multiple mnemonics?
Comment 8 Thomas Schindl CLA 2021-02-09 03:05:23 EST
OS-X has no concept of mnemonics ;-)
Comment 9 Andrey Loskutov CLA 2021-02-12 12:10:19 EST
(In reply to Rolf Theunissen from comment #7)
> How do other platforms handle multiple mnemonics?

Rolf, could you provide a trivial SWT snippet that shows the issue? I could check how that works on GTK.
Comment 10 Rolf Theunissen CLA 2021-02-13 05:26:55 EST
Created attachment 285547 [details]
SWT snippet to test the behavior
Comment 11 Rolf Theunissen CLA 2021-02-13 06:22:19 EST
(In reply to Gernot Hüller from comment #4)
> reported to jboss tools as https://issues.redhat.com/browse/JBIDE-27641

From that bug report, the two mnemonics are created because of a menuContribution that defines a label with mnemonic and as well it defines a mnemonic attribute. In this case the attribute is incorrectly defined. But in the general case, there is some undefined interaction in using the two mechanism for mnemonics. The same confusion is true for the E4 model, see Bug 405718.
Comment 12 Andrey Loskutov CLA 2021-02-15 05:04:55 EST
(In reply to Rolf Theunissen from comment #6)
> The second mnemonic is showed as underlined, however only the first mnemonic
> opens the menu. This is a SWT (or even win32) bug.

Same on Lunux / GTK 3.22 with your &Foo&Bar menu example. Alt+F opens the menu, Alt+B doesn't, but both F and B are underlined.