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..15e44b3c0bffbb39ae6e4853f135586ea90b8b83 100644 |
| --- a/ui/events/devices/x11/touch_factory_x11.cc |
| +++ b/ui/events/devices/x11/touch_factory_x11.cc |
| @@ -98,7 +98,8 @@ void TouchFactory::UpdateDeviceList(XDisplay* display) { |
| DeviceListCacheX11::GetInstance()->GetXI2DeviceList(display); |
| for (int i = 0; i < xi_dev_list.count; i++) { |
| const XIDeviceInfo& devinfo = xi_dev_list[i]; |
| - if (devinfo.use == XIFloatingSlave || devinfo.use == XIMasterPointer) { |
| + if (devinfo.use == XIFloatingSlave || devinfo.use == XIMasterPointer || |
| + devinfo.use == XISlavePointer) { |
| for (int k = 0; k < devinfo.num_classes; ++k) { |
| XIAnyClassInfo* xiclassinfo = devinfo.classes[k]; |
| if (xiclassinfo->type == XITouchClass) { |
| @@ -107,25 +108,10 @@ void TouchFactory::UpdateDeviceList(XDisplay* display) { |
| // Only care direct touch device (such as touch screen) right now |
| if (tci->mode == XIDirectTouch) { |
| touch_device_lookup_[devinfo.deviceid] = true; |
| - touch_device_list_[devinfo.deviceid] = true; |
| - } |
| - } |
| - } |
| - pointer_device_lookup_[devinfo.deviceid] = true; |
| - } else if (devinfo.use == XIMasterKeyboard) { |
| - virtual_core_keyboard_device_ = devinfo.deviceid; |
| - } |
| - |
| - if (devinfo.use == XIFloatingSlave || devinfo.use == XISlavePointer) { |
| - for (int k = 0; k < devinfo.num_classes; ++k) { |
| - XIAnyClassInfo* xiclassinfo = devinfo.classes[k]; |
| - if (xiclassinfo->type == XITouchClass) { |
| - XITouchClassInfo* tci = |
| - reinterpret_cast<XITouchClassInfo*>(xiclassinfo); |
| - // Only care direct touch device (such as touch screen) right now |
| - if (tci->mode == XIDirectTouch) { |
| - CacheTouchscreenIds(devinfo.deviceid); |
|
sadrul
2017/01/03 17:01:51
Looks like we are not caching the ids anymore?
|
| - if (devinfo.use == XISlavePointer) { |
| + touch_device_list_[devinfo.deviceid] = |
| + (devinfo.use != XISlavePointer); |
| + if (devinfo.use == XISlavePointer && |
| + IsValidDevice(devinfo.attachment)) { |
| device_master_id_list_[devinfo.deviceid] = devinfo.attachment; |
| // If the slave device is direct touch device, we also set its |
| // master device to be touch device. |
| @@ -135,6 +121,9 @@ void TouchFactory::UpdateDeviceList(XDisplay* display) { |
| } |
| } |
| } |
| + pointer_device_lookup_[devinfo.deviceid] = true; |
| + } else if (devinfo.use == XIMasterKeyboard) { |
| + virtual_core_keyboard_device_ = devinfo.deviceid; |
| } |
| } |
| } |