summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Westman <james@jwestman.net>2021-08-02 16:38:11 -0500
committerJames Westman <james@jwestman.net>2021-08-02 16:38:35 -0500
commitfb0229890bc4ff2d78185227a4448860eaec8d38 (patch)
tree0e05078a36b169587a7c3f4195306f53fe18508d
parentf59d2ae89de7da0e7fc37117be2592bfb2b78f34 (diff)
downloadgtk+-fb0229890bc4ff2d78185227a4448860eaec8d38.tar.gz
gtkgesturerotate: Fix assertion
Fixes #4144. An assertion would be printed when GtkGestureRotate was used with a touchscreen.
-rw-r--r--gtk/gtkgesturerotate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/gtkgesturerotate.c b/gtk/gtkgesturerotate.c
index 873302c422..5ecf7490b1 100644
--- a/gtk/gtkgesturerotate.c
+++ b/gtk/gtkgesturerotate.c
@@ -95,13 +95,13 @@ _gtk_gesture_rotate_get_angle (GtkGestureRotate *rotate,
goto out;
last_event = gtk_gesture_get_last_event (gesture, sequences->data);
- phase = gdk_touchpad_event_get_gesture_phase (last_event);
- if (gdk_event_get_event_type (last_event) == GDK_TOUCHPAD_PINCH &&
- (phase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN ||
- phase == GDK_TOUCHPAD_GESTURE_PHASE_UPDATE ||
- phase == GDK_TOUCHPAD_GESTURE_PHASE_END))
+ if (gdk_event_get_event_type (last_event) == GDK_TOUCHPAD_PINCH)
{
+ phase = gdk_touchpad_event_get_gesture_phase (last_event);
+ if (phase == GDK_TOUCHPAD_GESTURE_PHASE_CANCEL)
+ goto out;
+
*angle = priv->accum_touchpad_angle;
}
else