button: Reset in_button state in unmap

Since at that point the point is clearly not in the button anymore.
This commit is contained in:
Timm Bäder 2017-07-02 20:45:23 +02:00 committed by Matthias Clasen
parent e276f1e844
commit 1dd716e66f

View File

@ -182,6 +182,13 @@ gtk_button_remove (GtkContainer *container, GtkWidget *child)
GTK_CONTAINER_CLASS (gtk_button_parent_class)->remove (container, child); GTK_CONTAINER_CLASS (gtk_button_parent_class)->remove (container, 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 static void
gtk_button_class_init (GtkButtonClass *klass) gtk_button_class_init (GtkButtonClass *klass)
{ {
@ -208,6 +215,7 @@ gtk_button_class_init (GtkButtonClass *klass)
widget_class->leave_notify_event = gtk_button_leave_notify; widget_class->leave_notify_event = gtk_button_leave_notify;
widget_class->state_flags_changed = gtk_button_state_flags_changed; widget_class->state_flags_changed = gtk_button_state_flags_changed;
widget_class->grab_notify = gtk_button_grab_notify; widget_class->grab_notify = gtk_button_grab_notify;
widget_class->unmap = gtk_button_unmap;
container_class->add = gtk_button_add; container_class->add = gtk_button_add;
container_class->remove = gtk_button_remove; container_class->remove = gtk_button_remove;