Commit 73bf1740 authored by Matthias Clasen's avatar Matthias Clasen

Some additional auto-mnemonic fixes

Previously, we would also show mnemonics if the user hits
Ctrl+Alt, even though Ctrl+Alt+<x> does not actually trigger.
parent 6889d5b0
......@@ -1840,10 +1840,13 @@ gtk_main_do_event (GdkEvent *event)
if (gtk_invoke_key_snoopers (grab_widget, event))
break;
}
/* Catch alt press to enable auto-mnemonics;
* menus are handled elsewhere
* FIXME: this does not work with mnemonic modifiers other than Alt
*/
if ((event->key.keyval == GDK_KEY_Alt_L || event->key.keyval == GDK_KEY_Alt_R) &&
((event->key.state & (gtk_accelerator_get_default_mod_mask ()) & ~(GDK_RELEASE_MASK|GDK_MOD1_MASK)) == 0) &&
!GTK_IS_MENU_SHELL (grab_widget))
{
gboolean auto_mnemonics;
......
......@@ -5947,8 +5947,7 @@ maybe_set_mnemonics_visible (GtkWindow *window)
gdk_device_get_state (dev, gtk_widget_get_window (GTK_WIDGET (window)),
NULL, &mask);
if (window->priv->mnemonic_modifier & mask)
if (window->priv->mnemonic_modifier == (mask & gtk_accelerator_get_default_mod_mask ()))
{
gtk_window_set_mnemonics_visible (window, TRUE);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment