Mnemonics typing should be reproducible
Steps to reproduce
- Open GIMP
- Open a new image (ctrl+n)
- Hit
alt+i o
-> "Crop to content" is selected - Close the menu (Escape to cancel, or Enter to select "Crop to content", doesn't matter)
- Hit
alt+i o
-> "Image properties" is selected
Current behavior
When a GTK+ menu contains items with duplicate mnemonics, it seems to remember the previously selected one, even after being closed. Hence selected menu item with a given mnemonics combination alternates.
Expected outcome
Mnemonics are really meant to be used for muscle memory. A single sequence of keys should always end up with the same outcome.
So if you leave the menu opened, hitting o
repetitively would alternate between the 2 items. That is ok and good.
But if you close the menu, hitting directly alt+i o
should always get you the first o
item in the menu. Hitting alt+i o o
should always get you the second item. Closing the menu should therefore reset its selection state.
Version information
GTK+ 3.24.1 from Fedora 29 package management (gtk3-3.24.1-3.fc29.x86_64).
Tested with GIMP master development code (from today), though I expect it would happen with any GTK+3 application with duplicate mnemonics in menus.
Additional information
Obviously ideally there would be no mnemonics duplicate but this is hard to get (especially when your items are based on actions), and anyway I don't think that mnemonics duplicate is that big a problem if this issue was fixed (i.e. that a sequence of key always produce the same output), because alt+i o
or alt+i o o
are both pretty much instant when you know the sequence by heart (unfortunately it doesn't matter if you know it by heart if the output is always different).
Also it would allow to always use the first letter of the most relevant word in a menu item, which is most easier to guess when you type quickly (and therefore a much nicer mnemonics that some random letter in the middle of a word).