Commit 7580a7d0 authored by Changwan Ryu's avatar Changwan Ryu Committed by Commit Bot

Suppress magnifier when input is not focused

When the input is not focused but if you swipe horizontally on the
input element, we still try to show the magnifier.

This gesture seems to be silently ignored and it does not actually focus
and move the cursor, but we still trigger the magnifier. This can be
suppressed by checking the actual selection rect.

Bug: 1134492
Change-Id: I47214d6d1c9610258dba5b7c162781a9c60f4258
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2522571Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Changwan Ryu <changwan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824726}
parent e2b57581
...@@ -2460,8 +2460,12 @@ void RenderWidgetHostViewAndroid::OnSwipeToMoveCursorGestureAck( ...@@ -2460,8 +2460,12 @@ void RenderWidgetHostViewAndroid::OnSwipeToMoveCursorGestureAck(
} }
case blink::WebInputEvent::Type::kGestureScrollUpdate: { case blink::WebInputEvent::Type::kGestureScrollUpdate: {
gfx::RectF rect = touch_selection_controller_->GetRectBetweenBounds(); gfx::RectF rect = touch_selection_controller_->GetRectBetweenBounds();
selection_popup_controller_->OnDragUpdate( // Suppress this when the input is not focused, in which case rect will be
gfx::PointF(event.PositionInWidget().x(), rect.right_center().y())); // 0x0.
if (rect.width() != 0.f || rect.height() != 0.f) {
selection_popup_controller_->OnDragUpdate(
gfx::PointF(event.PositionInWidget().x(), rect.right_center().y()));
}
break; break;
} }
case blink::WebInputEvent::Type::kGestureScrollEnd: { case blink::WebInputEvent::Type::kGestureScrollEnd: {
......
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