Chromium Code Reviews| Index: ui/events/devices/x11/touch_factory_x11.cc |
| diff --git a/ui/events/devices/x11/touch_factory_x11.cc b/ui/events/devices/x11/touch_factory_x11.cc |
| index 3b91724f4f6a6e8ab31489fe58d92aec9648d434..0a1a2f8642487e5cfee0511ffa2254ab55d6c82f 100644 |
| --- a/ui/events/devices/x11/touch_factory_x11.cc |
| +++ b/ui/events/devices/x11/touch_factory_x11.cc |
| @@ -125,6 +125,8 @@ void TouchFactory::UpdateDeviceList(XDisplay* display) { |
| // Only care direct touch device (such as touch screen) right now |
| if (tci->mode == XIDirectTouch) { |
| CacheTouchscreenIds(devinfo.deviceid); |
| + touch_device_lookup_[devinfo.deviceid] = true; |
| + touch_device_list_[devinfo.deviceid] = false; |
|
sadrul
2016/12/12 16:02:06
I think this is getting fairly confusing. Can you
|
| if (devinfo.use == XISlavePointer) { |
| device_master_id_list_[devinfo.deviceid] = devinfo.attachment; |
| // If the slave device is direct touch device, we also set its |
| @@ -149,6 +151,9 @@ bool TouchFactory::ShouldProcessXI2Event(XEvent* xev) { |
| if (event->evtype == XI_TouchBegin || |
| event->evtype == XI_TouchUpdate || |
| event->evtype == XI_TouchEnd) { |
| + // TODO(chaopeng) we need to add deviceid to touch_device_lookup_ if this |
| + // assertion failed. |
| + DCHECK(touch_device_lookup_[xiev->deviceid]); |
| // Since SetupXI2ForXWindow() selects events from all devices, for a |
| // touchscreen attached to a master pointer device, X11 sends two |
| // events for each touch: one from the slave (deviceid == the id of |