[gtk+/gtk-3-0] gtk_menu_shell_activate shall remain private, seriously



commit 9833fbd77a63ee5dd8f6b5519831db2a4b29ebb9
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Apr 17 23:09:39 2011 -0400

    gtk_menu_shell_activate shall remain private, seriously
    
    What a travesty ! And all because I forgot to include gtkmenuitem.c
    in my first commit related to this.

 gtk/gtkmenuitem.c         |   21 ---------------------
 gtk/gtkmenushell.c        |    8 ++++----
 gtk/gtkmenushellprivate.h |    2 --
 3 files changed, 4 insertions(+), 27 deletions(-)
---
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index 38eddfc..9381317 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -170,25 +170,6 @@ G_DEFINE_TYPE_WITH_CODE (GtkMenuItem, gtk_menu_item, GTK_TYPE_BIN,
 
 
 static void
-_gtk_menu_shell_activate (GtkMenuShell *menu_shell)
-{
-  GtkMenuShellPrivate *priv = menu_shell->priv;
-
-  if (!priv->active)
-    {
-      GdkDevice *device;
-
-      device = gtk_get_current_event_device ();
-
-      _gtk_menu_shell_set_grab_device (menu_shell, device);
-      gtk_device_grab_add (GTK_WIDGET (menu_shell), device, TRUE);
-
-      priv->have_grab = TRUE;
-      priv->active = TRUE;
-    }
-}
-
-static void
 gtk_menu_item_class_init (GtkMenuItemClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
@@ -1772,8 +1753,6 @@ gtk_real_menu_item_activate_item (GtkMenuItem *menu_item)
         gtk_menu_shell_activate_item (menu_shell, widget, TRUE);
       else
         {
-          _gtk_menu_shell_activate (menu_shell);
-
           gtk_menu_shell_select_item (menu_shell, widget);
           _gtk_menu_item_popup_submenu (widget, FALSE);
 
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index 1a5a097..548bcaa 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -628,8 +628,8 @@ gtk_menu_shell_realize (GtkWidget *widget)
   gtk_style_context_set_background (context, window);
 }
 
-void
-_gtk_menu_shell_activate (GtkMenuShell *menu_shell)
+static void
+gtk_menu_shell_activate (GtkMenuShell *menu_shell)
 {
   GtkMenuShellPrivate *priv = menu_shell->priv;
 
@@ -697,7 +697,7 @@ gtk_menu_shell_button_press (GtkWidget      *widget,
               gtk_widget_get_parent (menu_item) == widget &&
               menu_item != priv->active_menu_item)
             {
-              _gtk_menu_shell_activate (menu_shell);
+              gtk_menu_shell_activate (menu_shell);
               priv->button = event->button;
 
               if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM)
@@ -1312,7 +1312,7 @@ gtk_menu_shell_real_select_item (GtkMenuShell *menu_shell,
       return;
     }
 
-  _gtk_menu_shell_activate (menu_shell);
+  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)
diff --git a/gtk/gtkmenushellprivate.h b/gtk/gtkmenushellprivate.h
index 1c6ed00..5c93b08 100644
--- a/gtk/gtkmenushellprivate.h
+++ b/gtk/gtkmenushellprivate.h
@@ -75,8 +75,6 @@ void       _gtk_menu_shell_set_keyboard_mode (GtkMenuShell *menu_shell,
                                               gboolean      keyboard_mode);
 gboolean   _gtk_menu_shell_get_keyboard_mode (GtkMenuShell *menu_shell);
 
-void       _gtk_menu_shell_activate          (GtkMenuShell *menu_shell);
-
 
 G_END_DECLS
 



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