[gtk+/gtk-3-0] GtkMenuShell: always 'activate' menu shells



commit f5eee56b56e2f371a0dc659f2d402b0cfc1c42c2
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Apr 13 13:28:46 2011 -0400

    GtkMenuShell: always 'activate' menu shells
    
    Failing to do so can leave us with a stuck grab in some cases.
    https://bugzilla.gnome.org/show_bug.cgi?id=554057

 gtk/gtkmenubar.c          |    1 -
 gtk/gtkmenushell.c        |    3 ++-
 gtk/gtkmenushellprivate.h |    1 -
 3 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index b35ec0c..b234b27 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -686,7 +686,6 @@ window_key_press_handler (GtkWidget   *widget,
 	      GtkMenuShell *menu_shell = GTK_MENU_SHELL (menubars->data);
 
               _gtk_menu_shell_set_keyboard_mode (menu_shell, TRUE);
-	      _gtk_menu_shell_activate (menu_shell);
 	      gtk_menu_shell_select_first (menu_shell, FALSE);
 	      
 	      g_list_free (menubars);
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index f210cab..0f22d47 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -1190,7 +1190,6 @@ gtk_real_menu_shell_deactivate (GtkMenuShell *menu_shell)
 
   if (priv->active)
     {
-
       priv->button = 0;
       priv->active = FALSE;
       priv->activate_time = 0;
@@ -1313,6 +1312,8 @@ gtk_menu_shell_real_select_item (GtkMenuShell *menu_shell,
       return;
     }
 
+  _gtk_menu_shell_activate (menu_shell);
+
   priv->active_menu_item = menu_item;
   if (pack_dir == GTK_PACK_DIRECTION_TTB || pack_dir == GTK_PACK_DIRECTION_BTT)
     _gtk_menu_item_set_placement (GTK_MENU_ITEM (priv->active_menu_item),
diff --git a/gtk/gtkmenushellprivate.h b/gtk/gtkmenushellprivate.h
index 6015f0c..5c93b08 100644
--- a/gtk/gtkmenushellprivate.h
+++ b/gtk/gtkmenushellprivate.h
@@ -58,7 +58,6 @@ struct _GtkMenuShellPrivate
 
 void        _gtk_menu_shell_select_last      (GtkMenuShell *menu_shell,
                                               gboolean      search_sensitive);
-void        _gtk_menu_shell_activate         (GtkMenuShell *menu_shell);
 gint        _gtk_menu_shell_get_popup_delay  (GtkMenuShell *menu_shell);
 void        _gtk_menu_shell_set_grab_device  (GtkMenuShell *menu_shell,
                                               GdkDevice    *device);



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