Commit a5c1ec5d authored by sadrul@chromium.org's avatar sadrul@chromium.org

touch: Filter touch events.

Ignore touch-move events that don't actually change the touch location.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6323010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71962 0039d316-1c4b-4281-b951-d872f2087c98
parent 0a179f96
......@@ -717,8 +717,16 @@ views::View::TouchStatus RenderWidgetHostViewViews::OnTouchEvent(
status = TOUCH_STATUS_CONTINUE;
// Update the location and state of the point.
UpdateTouchPointPosition(&e, GetPosition(), point);
point->state = TouchPointStateFromEvent(&e);
if (point->state == WebKit::WebTouchPoint::StateMoved) {
// It is possible for badly written touch drivers to emit Move events even
// when the touch location hasn't changed. In such cases, consume the event
// and pretend nothing happened.
if (point->position.x == e.x() && point->position.y == e.y()) {
return status;
}
}
UpdateTouchPointPosition(&e, GetPosition(), point);
// Mark the rest of the points as stationary.
for (int i = 0; i < touch_event_.touchPointsLength; ++i) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment