[gtk+/gestures: 51/55] scrolledwindow: Ensure the dragging sequence gets denied if more touches come in
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gestures: 51/55] scrolledwindow: Ensure the dragging sequence gets denied if more touches come in
- Date: Fri, 28 Mar 2014 22:53:59 +0000 (UTC)
commit 817ef4f41f6c112974c9173d8b4a57c96e036afd
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Mar 26 14:06:09 2014 +0100
scrolledwindow: Ensure the dragging sequence gets denied if more touches come in
This allows children to receive an emulated press, and handle it together with
the new touch that made the scrolledwindow sequence denied.
gtk/gtkscrolledwindow.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index f5eb9cd..7db8bfd 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -655,15 +655,14 @@ scrolled_window_drag_end_cb (GtkScrolledWindow *scrolled_window,
GtkGesture *gesture)
{
GtkScrolledWindowPrivate *priv = scrolled_window->priv;
+ GdkEventSequence *current, *last;
- if (!priv->in_drag)
- {
- GdkEventSequence *sequence;
+ current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
+ last = gtk_gesture_get_last_updated_sequence (gesture);
- sequence = gtk_gesture_get_last_updated_sequence (gesture);
- gtk_widget_set_sequence_state (GTK_WIDGET (scrolled_window),
- sequence, GTK_EVENT_SEQUENCE_DENIED);
- }
+ if (!priv->in_drag || current != last)
+ gtk_widget_set_sequence_state (GTK_WIDGET (scrolled_window),
+ current, GTK_EVENT_SEQUENCE_DENIED);
}
static void
@@ -715,8 +714,11 @@ scrolled_window_long_press_cancelled_cb (GtkScrolledWindow *scrolled_window,
sequence = gtk_gesture_get_last_updated_sequence (gesture);
event = gtk_gesture_get_last_event (gesture, sequence);
- if (event->type != GDK_TOUCH_END &&
- event->type != GDK_BUTTON_RELEASE)
+ if (event->type == GDK_TOUCH_BEGIN)
+ gtk_widget_set_gesture_state (GTK_WIDGET (scrolled_window), gesture,
+ GTK_EVENT_SEQUENCE_DENIED);
+ else if (event->type != GDK_TOUCH_END &&
+ event->type != GDK_BUTTON_RELEASE)
priv->in_drag = TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]