Bug 552318 – menubar mnemonics consumed even when
2008-10-13 Matthias Clasen <mclasen@redhat.com> Bug 552318 – menubar mnemonics consumed even when gtk-enable-mnemonics=false * gtk/gtkwindow.c (gtk_window_activate_key): Don't let mnemonic entries block accelerator activation when gtk-enable-mnemonics is FALSE. Problem reported by Andreas Moog. svn path=/trunk/; revision=21648
This commit is contained in:
parent
d834ef6b2f
commit
784896ae1e
@ -1,3 +1,12 @@
|
||||
2008-10-13 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Bug 552318 – menubar mnemonics consumed even when
|
||||
gtk-enable-mnemonics=false
|
||||
|
||||
* gtk/gtkwindow.c (gtk_window_activate_key): Don't let mnemonic
|
||||
entries block accelerator activation when gtk-enable-mnemonics is
|
||||
FALSE. Problem reported by Andreas Moog.
|
||||
|
||||
2008-10-13 Cody Russell <cody@jhu.edu>
|
||||
|
||||
* test/testfilechooser.c: Fix option parsing so that -a and
|
||||
|
@ -8028,6 +8028,8 @@ gtk_window_activate_key (GtkWindow *window,
|
||||
{
|
||||
GtkKeyHash *key_hash;
|
||||
GtkWindowKeyEntry *found_entry = NULL;
|
||||
gboolean enable_mnemonics;
|
||||
gboolean enable_accels;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
@ -8036,39 +8038,43 @@ gtk_window_activate_key (GtkWindow *window,
|
||||
|
||||
if (key_hash)
|
||||
{
|
||||
GSList *tmp_list;
|
||||
GSList *entries = _gtk_key_hash_lookup (key_hash,
|
||||
event->hardware_keycode,
|
||||
event->state,
|
||||
gtk_accelerator_get_default_mod_mask (),
|
||||
event->group);
|
||||
GSList *tmp_list;
|
||||
|
||||
for (tmp_list = entries; tmp_list; tmp_list = tmp_list->next)
|
||||
{
|
||||
GtkWindowKeyEntry *entry = tmp_list->data;
|
||||
if (entry->is_mnemonic)
|
||||
{
|
||||
found_entry = entry;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found_entry && entries)
|
||||
found_entry = entries->data;
|
||||
|
||||
g_slist_free (entries);
|
||||
}
|
||||
|
||||
if (found_entry)
|
||||
{
|
||||
gboolean enable_mnemonics;
|
||||
gboolean enable_accels;
|
||||
|
||||
g_object_get (gtk_widget_get_settings (GTK_WIDGET (window)),
|
||||
"gtk-enable-mnemonics", &enable_mnemonics,
|
||||
"gtk-enable-accels", &enable_accels,
|
||||
NULL);
|
||||
|
||||
for (tmp_list = entries; tmp_list; tmp_list = tmp_list->next)
|
||||
{
|
||||
GtkWindowKeyEntry *entry = tmp_list->data;
|
||||
if (entry->is_mnemonic)
|
||||
{
|
||||
if (enable_mnemonics)
|
||||
{
|
||||
found_entry = entry;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (enable_accels && !found_entry)
|
||||
{
|
||||
found_entry = entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_slist_free (entries);
|
||||
}
|
||||
|
||||
if (found_entry)
|
||||
{
|
||||
if (found_entry->is_mnemonic)
|
||||
{
|
||||
if (enable_mnemonics)
|
||||
|
Loading…
Reference in New Issue
Block a user