summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-08-09 22:58:22 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-08-09 22:58:22 -0400
commit6fafc8b8119369bda96afe1ede18a2af42d5c89f (patch)
tree7e6ab339fd49ac6feb93fdbc66667193851140ee /gtk
parentbc20fe3cca72b384e9002ac47503e606e7247121 (diff)
downloadgtk+-6fafc8b8119369bda96afe1ede18a2af42d5c89f.tar.gz
button: Claim click events
This fixes issues with double activation on clicks. Fixes: #3054
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkbutton.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index eac1499b0d..c242b28c64 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -319,12 +319,16 @@ click_pressed_cb (GtkGestureClick *gesture,
{
GtkButton *button = GTK_BUTTON (widget);
GtkButtonPrivate *priv = gtk_button_get_instance_private (button);
+ GdkEventSequence *sequence;
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);
+
if (!priv->activate_timeout)
priv->button_down = TRUE;
}