[gtk+] button: Call the new function



commit 9a0064c684f8b91963eb152d7708cd12d355b5c2
Author: Benjamin Otte <otte redhat com>
Date:   Mon Dec 2 21:24:30 2013 +0100

    button: Call the new function
    
    This simplifies a lot of code and doesn't require hacks setting
    in_button anymore.

 gtk/gtkbutton.c |   29 +++--------------------------
 1 files changed, 3 insertions(+), 26 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 21c537c..6bcf197 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -1995,21 +1995,8 @@ gtk_button_grab_broken (GtkWidget          *widget,
                        GdkEventGrabBroken *event)
 {
   GtkButton *button = GTK_BUTTON (widget);
-  GtkButtonPrivate *priv = button->priv;
-  gboolean save_in;
   
-  /* Simulate a button release without the pointer in the button */
-  if (priv->button_down)
-    {
-      save_in = priv->in_button;
-      priv->in_button = FALSE;
-      gtk_real_button_released (button);
-      if (save_in != priv->in_button)
-       {
-         priv->in_button = save_in;
-         gtk_button_update_state (button);
-       }
-    }
+  gtk_button_do_release (button, FALSE);
 
   return TRUE;
 }
@@ -2721,7 +2708,7 @@ gtk_button_state_changed (GtkWidget    *widget,
   if (!gtk_widget_is_sensitive (widget))
     {
       priv->in_button = FALSE;
-      gtk_real_button_released (button);
+      gtk_button_do_release (button, FALSE);
     }
 }
 
@@ -2731,7 +2718,6 @@ gtk_button_grab_notify (GtkWidget *widget,
 {
   GtkButton *button = GTK_BUTTON (widget);
   GtkButtonPrivate *priv = button->priv;
-  gboolean save_in;
 
   if (priv->activate_timeout &&
       priv->grab_keyboard &&
@@ -2739,16 +2725,7 @@ gtk_button_grab_notify (GtkWidget *widget,
     gtk_button_finish_activate (button, FALSE);
 
   if (!was_grabbed)
-    {
-      save_in = priv->in_button;
-      priv->in_button = FALSE;
-      gtk_real_button_released (button);
-      if (save_in != priv->in_button)
-        {
-          priv->in_button = save_in;
-          gtk_button_update_state (button);
-        }
-    }
+    gtk_button_do_release (button, FALSE);
 }
 
 /**


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