[gtk+/wip/baedert/drawing: 327/355] button: Reset in_button state in unmap



commit 49071cc830a9d90a0d5e87fbd49c6a37328b0731
Author: Timm Bäder <mail baedert org>
Date:   Sun Jul 2 20:45:23 2017 +0200

    button: Reset in_button state in unmap
    
    Since at that point the point is clearly not in the button anymore.

 gtk/gtkbutton.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 0159322..d663d12 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -183,6 +183,13 @@ gtk_button_remove (GtkContainer *container, GtkWidget *child)
 }
 
 static void
+gtk_button_unmap (GtkWidget *widget)
+{
+  GTK_BUTTON (widget)->priv->in_button = FALSE;
+  GTK_WIDGET_CLASS (gtk_button_parent_class)->unmap (widget);
+}
+
+static void
 gtk_button_class_init (GtkButtonClass *klass)
 {
   GObjectClass *gobject_class;
@@ -208,6 +215,7 @@ gtk_button_class_init (GtkButtonClass *klass)
   widget_class->leave_notify_event = gtk_button_leave_notify;
   widget_class->state_flags_changed = gtk_button_state_flags_changed;
   widget_class->grab_notify = gtk_button_grab_notify;
+  widget_class->unmap = gtk_button_unmap;
 
   container_class->add    = gtk_button_add;
   container_class->remove = gtk_button_remove;


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