Index: ui/events/gestures/motion_event_aura.cc |
diff --git a/ui/events/gestures/motion_event_aura.cc b/ui/events/gestures/motion_event_aura.cc |
index 2f532e7f325f6ad0e9f5d211bdba2707ca89834f..174918fedc5a545da380fd2efd3205e36c3e3258 100644 |
--- a/ui/events/gestures/motion_event_aura.cc |
+++ b/ui/events/gestures/motion_event_aura.cc |
@@ -82,12 +82,17 @@ bool MotionEventAura::OnTouch(const TouchEvent& touch) { |
bool pointer_id_is_active = index != -1; |
if (touch.type() == ET_TOUCH_PRESSED && pointer_id_is_active) { |
- // Ignore touch press events if we already believe the pointer is down. |
- |
- // TODO(tdresser): this should return false (or NOTREACHED()); |
- // however, there is at least one case where we need to allow a |
- // touch press from a currently used touch id. See |
+ // TODO(tdresser): This should return false (or NOTREACHED()), and |
+ // ignore the touch; however, there is at least one case where we |
+ // need to allow a touch press from a currently used touch id. See |
// crbug.com/446852 for details. |
+ |
+ // Cancel the existing touch, before handling the touch press. |
+ TouchEvent cancel(ET_TOUCH_CANCELLED, touch.location(), touch.touch_id(), |
+ touch.time_stamp()); |
+ OnTouch(cancel); |
+ CleanupRemovedTouchPoints(cancel); |
+ DCHECK_EQ(-1, FindPointerIndexOfId(touch.touch_id())); |
} else if (touch.type() != ET_TOUCH_PRESSED && !pointer_id_is_active) { |
// We could have an active touch stream transfered to us, resulting in touch |
// move or touch up events without associated touch down events. Ignore |