Commit b1a6fb2a authored by Randy Rossi's avatar Randy Rossi Committed by Commit Bot

Don't allow second finger to clobber initial press

If we are already in one finger passthrough mode
triggered by press on the edge, don't allow other
fingers to clobber the initial press. Otherwise
we will never send the release for the first
finger.

Bug: None
Test: display assistant with screen reader enabled, back gesture
Change-Id: I742102eeb3fad05f7a32b6c7cdd34b9036f6ddaf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2108866
Commit-Queue: Alex Sakhartchouk <alexst@chromium.org>
Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Reviewed-by: default avatarAlex Sakhartchouk <alexst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751685}
parent 23c738ec
...@@ -195,6 +195,12 @@ ui::EventDispatchDetails TouchExplorationController::RewriteEvent( ...@@ -195,6 +195,12 @@ ui::EventDispatchDetails TouchExplorationController::RewriteEvent(
if (side_gesture_pass_through_ && type == ui::ET_TOUCH_PRESSED && if (side_gesture_pass_through_ && type == ui::ET_TOUCH_PRESSED &&
FindEdgesWithinInset(location, gesture_start_width_, FindEdgesWithinInset(location, gesture_start_width_,
gesture_start_height_) != NO_EDGE) { gesture_start_height_) != NO_EDGE) {
// If we are already in pass-through, ignore additional presses
// or the other fingers will clobber our initial press.
if (state_ == ONE_FINGER_PASSTHROUGH) {
return DiscardEvent(continuation);
}
SET_STATE(ONE_FINGER_PASSTHROUGH); SET_STATE(ONE_FINGER_PASSTHROUGH);
initial_press_ = std::make_unique<ui::TouchEvent>(touch_event); initial_press_ = std::make_unique<ui::TouchEvent>(touch_event);
passthrough_offset_ = gfx::Vector2dF(0, 0); passthrough_offset_ = gfx::Vector2dF(0, 0);
......
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