After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697144 - Popup menu mnemonics fixes
Popup menu mnemonics fixes
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-04-02 20:52 UTC by Cosimo Cecchi
Modified: 2013-04-02 21:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: reset timeout source id before setting property (937 bytes, patch)
2013-04-02 20:52 UTC, Cosimo Cecchi
committed Details | Review
window: rename functions dealing with mnemonic delayed display (4.40 KB, patch)
2013-04-02 20:52 UTC, Cosimo Cecchi
committed Details | Review
window: refactor a function (1.93 KB, patch)
2013-04-02 20:52 UTC, Cosimo Cecchi
committed Details | Review
window: don't schedule a display of mnemonics if window has no modifier (1.25 KB, patch)
2013-04-02 20:52 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2013-04-02 20:52:36 UTC
See attached patchset. This fixes the annoying bug where mnemonics are displayed automatically when a popup menu is shown.
Comment 1 Cosimo Cecchi 2013-04-02 20:52:39 UTC
Created attachment 240432 [details] [review]
window: reset timeout source id before setting property

gtk_window_set_mnemonics_visible() will try to g_source_remove() it
otherwise, which seems harmless, but conceptually wrong.
Comment 2 Cosimo Cecchi 2013-04-02 20:52:43 UTC
Created attachment 240433 [details] [review]
window: rename functions dealing with mnemonic delayed display

Don't mention "auto mnemonics", since those methods are purely about
scheduling a delayed display, and that makes understanding the code a
bit harder.
Comment 3 Cosimo Cecchi 2013-04-02 20:52:47 UTC
Created attachment 240434 [details] [review]
window: refactor a function

Instead of having maybe_set_mnemonics_visible(), separate the checks
from the actual scheduling of mnemonics display.
Comment 4 Cosimo Cecchi 2013-04-02 20:52:51 UTC
Created attachment 240435 [details] [review]
window: don't schedule a display of mnemonics if window has no modifier

When the window has no mnemonics modifier set, as in the case of a
GtkMenu, never schedule a display of mnemonics on focus-in.

Previously, for those windows, the GdkModifierType mask fetched from the
device would typically have been zero, leading to the

mnemonic_modifier == (mask & gtk_accelerator_get_default_mod_mask ())

check to succeed, so we would always trigger a display for popup menus.
Comment 5 Matthias Clasen 2013-04-02 21:30:38 UTC
Review of attachment 240432 [details] [review]:

sure
Comment 6 Matthias Clasen 2013-04-02 21:31:22 UTC
Review of attachment 240433 [details] [review]:

fine with me
Comment 7 Matthias Clasen 2013-04-02 21:32:10 UTC
Review of attachment 240434 [details] [review]:

ok
Comment 8 Matthias Clasen 2013-04-02 21:34:33 UTC
Review of attachment 240435 [details] [review]:

good catch
Comment 9 Cosimo Cecchi 2013-04-02 21:39:12 UTC
Attachment 240432 [details] pushed as a101e85 - window: reset timeout source id before setting property
Attachment 240433 [details] pushed as 1b3f5d3 - window: rename functions dealing with mnemonic delayed display
Attachment 240434 [details] pushed as 4a8203a - window: refactor a function
Attachment 240435 [details] pushed as 66b0b28 - window: don't schedule a display of mnemonics if window has no modifier