[gtk/wip/carlosg/for-master: 5/5] gtkbutton: Clean up priv->in_button




commit d9d494826fac4a0cb7f0a8830a508373e3a4f711
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Sep 25 19:15:29 2020 +0200

    gtkbutton: Clean up priv->in_button
    
    This is now only toggled around, may be cleaned up.

 gtk/gtkbutton.c | 21 ---------------------
 1 file changed, 21 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index f2e6701850..8ef124da83 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -94,7 +94,6 @@ struct _GtkButtonPrivate
   guint                  activate_timeout;
 
   guint          button_down           : 1;
-  guint          in_button             : 1;
   guint          use_underline         : 1;
   guint          child_type            : 2;
 };
@@ -158,16 +157,6 @@ G_DEFINE_TYPE_WITH_CODE (GtkButton, gtk_button, GTK_TYPE_WIDGET,
                          G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, gtk_button_buildable_iface_init)
                          G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIONABLE, gtk_button_actionable_iface_init))
 
-static void
-gtk_button_unmap (GtkWidget *widget)
-{
-  GtkButtonPrivate *priv = gtk_button_get_instance_private (GTK_BUTTON (widget));
-
-  priv->in_button = FALSE;
-
-  GTK_WIDGET_CLASS (gtk_button_parent_class)->unmap (widget);
-}
-
 static void
 gtk_button_compute_expand (GtkWidget *widget,
                            gboolean  *hexpand,
@@ -216,7 +205,6 @@ gtk_button_class_init (GtkButtonClass *klass)
 
   widget_class->unrealize = gtk_button_unrealize;
   widget_class->state_flags_changed = gtk_button_state_flags_changed;
-  widget_class->unmap = gtk_button_unmap;
   widget_class->compute_expand = gtk_button_compute_expand;
   widget_class->get_request_mode = gtk_button_get_request_mode;
 
@@ -327,8 +315,6 @@ click_pressed_cb (GtkGestureClick *gesture,
   if (gtk_widget_get_focus_on_click (widget) && !gtk_widget_has_focus (widget))
     gtk_widget_grab_focus (widget);
 
-  priv->in_button = TRUE;
-
   sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
   gtk_gesture_set_sequence_state (GTK_GESTURE (gesture), sequence, GTK_EVENT_SEQUENCE_CLAIMED);
 
@@ -344,17 +330,11 @@ click_released_cb (GtkGestureClick *gesture,
                    GtkWidget       *widget)
 {
   GtkButton *button = GTK_BUTTON (widget);
-  GdkEventSequence *sequence;
 
   gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
   gtk_button_do_release (button,
                          gtk_widget_is_sensitive (GTK_WIDGET (button)) &&
                          gtk_widget_contains (widget, x, y));
-
-  sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
-
-  if (sequence)
-    priv->in_button = FALSE;
 }
 
 static void
@@ -420,7 +400,6 @@ gtk_button_init (GtkButton *button)
   gtk_widget_set_focusable (GTK_WIDGET (button), TRUE);
   gtk_widget_set_receives_default (GTK_WIDGET (button), TRUE);
 
-  priv->in_button = FALSE;
   priv->button_down = FALSE;
   priv->use_underline = FALSE;
   priv->child_type = WIDGET_CHILD;


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