summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/gtkgesturelongpress.c10
-rw-r--r--gtk/gtkgesturemultipress.c1
-rw-r--r--gtk/gtkgesturesingle.c13
3 files changed, 18 insertions, 6 deletions
diff --git a/gtk/gtkgesturelongpress.c b/gtk/gtkgesturelongpress.c
index f2971b3b36..09ac12df4a 100644
--- a/gtk/gtkgesturelongpress.c
+++ b/gtk/gtkgesturelongpress.c
@@ -176,6 +176,14 @@ gtk_gesture_long_press_end (GtkGesture *gesture,
}
static void
+gtk_gesture_long_press_cancel (GtkGesture *gesture,
+ GdkEventSequence *sequence)
+{
+ gtk_gesture_long_press_end (gesture, sequence);
+ GTK_GESTURE_CLASS (gtk_gesture_long_press_parent_class)->cancel (gesture, sequence);
+}
+
+static void
gtk_gesture_long_press_sequence_state_changed (GtkGesture *gesture,
GdkEventSequence *sequence,
GtkEventSequenceState state)
@@ -209,7 +217,7 @@ gtk_gesture_long_press_class_init (GtkGestureLongPressClass *klass)
gesture_class->begin = gtk_gesture_long_press_begin;
gesture_class->update = gtk_gesture_long_press_update;
gesture_class->end = gtk_gesture_long_press_end;
- gesture_class->cancel = gtk_gesture_long_press_end;
+ gesture_class->cancel = gtk_gesture_long_press_cancel;
gesture_class->sequence_state_changed =
gtk_gesture_long_press_sequence_state_changed;
diff --git a/gtk/gtkgesturemultipress.c b/gtk/gtkgesturemultipress.c
index 1f499768fd..7b0067164c 100644
--- a/gtk/gtkgesturemultipress.c
+++ b/gtk/gtkgesturemultipress.c
@@ -279,6 +279,7 @@ gtk_gesture_multi_press_cancel (GtkGesture *gesture,
GdkEventSequence *sequence)
{
_gtk_gesture_multi_press_stop (GTK_GESTURE_MULTI_PRESS (gesture));
+ GTK_GESTURE_CLASS (gtk_gesture_multi_press_parent_class)->cancel (gesture, sequence);
}
static void
diff --git a/gtk/gtkgesturesingle.c b/gtk/gtkgesturesingle.c
index ac91851808..d33f190292 100644
--- a/gtk/gtkgesturesingle.c
+++ b/gtk/gtkgesturesingle.c
@@ -112,14 +112,15 @@ gtk_gesture_single_set_property (GObject *object,
}
static void
-gtk_gesture_single_reset (GtkEventController *controller)
+gtk_gesture_single_cancel (GtkGesture *gesture,
+ GdkEventSequence *sequence)
{
GtkGestureSinglePrivate *priv;
- priv = gtk_gesture_single_get_instance_private (GTK_GESTURE_SINGLE (controller));
- priv->current_button = 0;
+ priv = gtk_gesture_single_get_instance_private (GTK_GESTURE_SINGLE (gesture));
- GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_single_parent_class)->reset (controller);
+ if (sequence == priv->current_sequence)
+ priv->current_button = 0;
}
static gboolean
@@ -219,14 +220,16 @@ static void
gtk_gesture_single_class_init (GtkGestureSingleClass *klass)
{
GtkEventControllerClass *controller_class = GTK_EVENT_CONTROLLER_CLASS (klass);
+ GtkGestureClass *gesture_class = GTK_GESTURE_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = gtk_gesture_single_get_property;
object_class->set_property = gtk_gesture_single_set_property;
- controller_class->reset = gtk_gesture_single_reset;
controller_class->handle_event = gtk_gesture_single_handle_event;
+ gesture_class->cancel = gtk_gesture_single_cancel;
+
/**
* GtkGestureSingle:touch-only:
*