New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 714845 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Mouse drag selection broken on Android

Project Member Reported by aelias@chromium.org, Apr 24 2017

Issue description

1) Plug in a physical mouse to a Nexus 6P via USB-C hub or bluetooth.
2) Visit http://en.wikipedia.org/
3) Drag on top of text.

Expected: Text becomes selected blue.
Actual: Nothing happens.

Exactly bisected to http://crrev.com/459942 "chrome/android: Remove EdgeSwipeEventHandler."  I've also noted by logging on a ToT build that no MotionEvents are sent to the ContentView during the drag.  So this seemingly unrelated handler must've had a useful side effect on mouse events.
 

Comment 1 by aelias@chromium.org, Apr 25 2017

Owner: khushals...@chromium.org

Comment 2 by aelias@chromium.org, Apr 25 2017

After locally reverting, I notice the reason it worked before is that an ACTION_MOVE MotionEvent is sent up to LayoutManager.propagateEvent, and from there to ContentView.onTouchEvent.
This looks like a weird android issue. I tried this on ContentShell and I don't see the drag working there as well, which shouldn't be affected by this change. The quick solution would be to always intercept the event and forward it to the ContentView, similar to what the EdgeSwipeEventHandler was doing.

Comment 4 by aelias@chromium.org, Apr 25 2017

Hmm, does this also mean mouse drag selection never worked in WebView, even in M58?
Cc: boliu@chromium.org
Tried WebView on ToT and 58, it doesn't work on either. So looks like just having the Layout code route events directly to the ContentView was somehow keeping this working in Chrome.

Comment 6 by boliu@chromium.org, Apr 25 2017

what's the real problem though, in webview or content shell? onGenericMotionEvent is hooked up correctly afaict?
Its in content. I think we are rejecting the down event somewhere so we don't get the rest of the move events. The EventFilter code that was deleted would dispatch the event to content view but always return true for it, irrespective of whether the content view consumed it or not.

Comment 8 by boliu@chromium.org, Apr 25 2017

ok, so I guess revert for m59, but should fix the real issue on trunk
Still doesn't work on WebView though. :/
Project Member

Comment 11 by bugdroid1@chromium.org, Apr 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6bc101ebf27a7a56f28d5264aed265ec43a8db45

commit 6bc101ebf27a7a56f28d5264aed265ec43a8db45
Author: khushalsagar <khushalsagar@chromium.org>
Date: Thu Apr 27 20:46:04 2017

chrome/android: Consume down events for mouse drag gesture.

Mouse drag gestures on android are delivered using a stream of
ACTION_MOVE events. If the view does not consume the ACTION_DOWN event
that starts the gesture, it will not receive the following move events.

Consume this event in the EventForwarder to ensure the ContentView gets
the complete gesture.

BUG= 714845 

Review-Url: https://codereview.chromium.org/2842823002
Cr-Commit-Position: refs/heads/master@{#467780}

[modify] https://crrev.com/6bc101ebf27a7a56f28d5264aed265ec43a8db45/ui/android/java/src/org/chromium/ui/base/EventForwarder.java

Labels: Merge-Request-59
Project Member

Comment 13 by sheriffbot@chromium.org, Apr 27 2017

Labels: -Merge-Request-59 Hotlist-Merge-Approved Merge-Approved-59
Your change meets the bar and is auto-approved for M59. Please go ahead and merge the CL to branch 3071 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), gkihumba@(ChromeOS), Abdul Syed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 14 by bugdroid1@chromium.org, Apr 27 2017

Labels: -merge-approved-59 merge-merged-3071
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1c0d3e95679659c1b01785b9fc666aa9a8de0431

commit 1c0d3e95679659c1b01785b9fc666aa9a8de0431
Author: Khushal <khushalsagar@google.com>
Date: Thu Apr 27 22:40:22 2017

chrome/android: Consume down events for mouse drag gesture.

Mouse drag gestures on android are delivered using a stream of
ACTION_MOVE events. If the view does not consume the ACTION_DOWN event
that starts the gesture, it will not receive the following move events.

Consume this event in the EventForwarder to ensure the ContentView gets
the complete gesture.

BUG= 714845 

Review-Url: https://codereview.chromium.org/2842823002
Cr-Commit-Position: refs/heads/master@{#467780}
(cherry picked from commit 6bc101ebf27a7a56f28d5264aed265ec43a8db45)

Review-Url: https://codereview.chromium.org/2851473006 .
Cr-Commit-Position: refs/branch-heads/3071@{#276}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[modify] https://crrev.com/1c0d3e95679659c1b01785b9fc666aa9a8de0431/ui/android/java/src/org/chromium/ui/base/EventForwarder.java

Status: Fixed (was: Assigned)

Comment 16 by boliu@chromium.org, Apr 27 2017

so webview is still broken for unknown reason?
No, this fixes Webview too. I wasn't testing for it correctly initially. :P

Comment 18 by boliu@chromium.org, Apr 27 2017

cool, thanks
verified on Chrome:59.0.3071.37 device:Nexus 6P/OPR1.170501.001.But when we click on any word the  Contextual search is not working 
That isn't a regression. I tried on 58 and it doesn't work there either. Please file a feature request bug for it.
Cc: prashanthpola@chromium.org
Contextual search is not supposed to trigger on mouse click.  It did in 57 and below as an unintended result of mapping mouse to touch.
Re:#21 Okay. The contextual search is working with mouse click on Samsung devices.

Sign in to add a comment