summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-08-05 22:42:41 +0000
committerMatthias Clasen <mclasen@redhat.com>2020-08-05 22:42:41 +0000
commit66df338087fcf5f818325452734412f4f24049c4 (patch)
tree7218d173a5ca304f33cbfe769e8a357d678bd28c
parentd1718355cd479bba0d03537af4e1f24947709744 (diff)
parentbb3675b3c7e2589a6e50acc56c834e0710e53000 (diff)
downloadgtk+-66df338087fcf5f818325452734412f4f24049c4.tar.gz
Merge branch 'wip/carlosg/stop-spinbutton-stop' into 'master'
Let spinbuttons stop Closes #3016 See merge request GNOME/gtk!2380
-rw-r--r--gtk/gtkbutton.c3
-rw-r--r--gtk/gtkgesture.c4
-rw-r--r--gtk/gtkspinbutton.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 843c1f49a0..eac1499b0d 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -327,8 +327,6 @@ click_pressed_cb (GtkGestureClick *gesture,
if (!priv->activate_timeout)
priv->button_down = TRUE;
-
- gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
}
static gboolean
@@ -364,6 +362,7 @@ click_released_cb (GtkGestureClick *gesture,
GtkButtonPrivate *priv = gtk_button_get_instance_private (button);
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)) &&
(priv->in_button ||
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c
index 1a791d3339..544ef87bd3 100644
--- a/gtk/gtkgesture.c
+++ b/gtk/gtkgesture.c
@@ -1014,6 +1014,10 @@ gtk_gesture_set_sequence_state (GtkGesture *gesture,
data->state != GTK_EVENT_SEQUENCE_NONE)
return FALSE;
+ if (state == GTK_EVENT_SEQUENCE_DENIED &&
+ data->state == GTK_EVENT_SEQUENCE_CLAIMED)
+ _gtk_gesture_cancel_sequence (gesture, sequence);
+
data->state = state;
gtk_widget_cancel_event_sequence (gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture)),
gesture, sequence, state);
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 01466dda23..0927efba90 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -851,6 +851,8 @@ button_pressed_cb (GtkGestureClick *gesture,
start_spinning (spin_button, pressed_button, gtk_adjustment_get_step_increment (spin_button->adjustment));
else if (button == GDK_BUTTON_MIDDLE)
start_spinning (spin_button, pressed_button, gtk_adjustment_get_page_increment (spin_button->adjustment));
+
+ gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
}
else
{