New issue
Advanced search Search tips

Issue 678074 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Unexpected MouseMove event when touch the touch screen

Project Member Reported by chaopeng@chromium.org, Jan 3 2017

Issue description

Chrome Version: 55.0.2883.87
OS: Linux

What steps will reproduce the problem?
(1) Add log to |LayerTreeHostImpl::MouseMoveAt|
(2) touch chrome from touch screen
(3) see a mouse move and without any flag show it came from touch screen

What is the expected result?

1) Dont have this mouse move because we have a generic one to update hover state and send to js. 
2) Or the mouse move event has a flag show it come from touch screen.
 
Cc: sadrul@chromium.org
Why we got the mouse move

Everytime we touch via touch screen we got 2 XI_Motion from X11. 

```
> xinput
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Acer T231H                              	id=10	[slave  pointer  (2)]
⎜   ↳ Logitech USB-PS/2 Optical Mouse         	id=11	[slave  pointer  (2)]
```

1. sourceid=10(slave) deviceid=2(master)
2. sourceid=10(slave) deviceid=10(slave)

The second one filtered in ShouldProcessXI2Event in this line:

https://cs.chromium.org/chromium/src/ui/events/devices/x11/touch_factory_x11.cc?sq=package:chromium&dr=CSs&rcl=1483575682&l=182


```
if (!pointer_device_lookup_[xiev->deviceid])
```

because we dont add slave id in pointer_device_lookup_.

But the first one pass then back to EventTypeFromXEvent. 

In EventTypeFromXEvent
https://cs.chromium.org/chromium/src/ui/events/x/events_x_utils.cc?cl=GROK&gsn=EventTypeFromNative&rcl=1483575682&l=401

```
if (factory->IsTouchDevice(xievent->sourceid))
```

We check if it is touch device by sourceid, we got false because we dont put the slave id to touch_device_lookup_. Then it return a mousemove event type. Also in GetTouchEventType we filter the XI_Motion event that is why we can put the slave id to touch_device_lookup_ to filter this XI_Motion.
Labels: Hotlist-Input-Dev
Components: Blink>Input
Status: Assigned (was: Started)
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 13 2017

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

commit 1d64628a6b9a59469503b6a82a68606a09950d9a
Author: chaopeng <chaopeng@chromium.org>
Date: Mon Mar 13 21:22:45 2017

Add slave touch device to touch_device_lookup_ and touch_device_list_

Unexpected MouseMove event when touch the touch screen issue is because we
didn't add slave touch device to touch_device_lookup_ and touch_device_list_
then we got false when we check if it is from touch screen by sourceid(not
device id).

This patch we add slave touch device to touch_device_lookup_ and
touch_device_list_.

BUG= 678074 

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

[modify] https://crrev.com/1d64628a6b9a59469503b6a82a68606a09950d9a/ui/events/devices/x11/touch_factory_x11.cc

Status: Fixed (was: Assigned)

Sign in to add a comment