[gtk+/gtk-3-8] window: don't schedule a display of mnemonics if window has no modifier



commit 66b0b287f1313b2b94426b95d17ab6f630ac997f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Apr 2 16:36:30 2013 -0400

    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.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697144

 gtk/gtkwindow.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index eb40959..a8dfd31 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6169,6 +6169,9 @@ gtk_window_has_mnemonic_modifier_pressed (GtkWindow *window)
   GdkDeviceManager *device_manager;
   gboolean retval = FALSE;
 
+  if (!window->priv->mnemonic_modifier)
+    return FALSE;
+
   device_manager = gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET (window)));
   devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]