Chromium Code Reviews

Unified Diff: ui/events/devices/x11/touch_factory_x11.cc

Issue 1186833005: Fix touch screen on Linux with or without flag --touch-devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « ui/events/devices/x11/touch_factory_x11.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a971b1033afc73a6d6ce22b8b835a98d554ed452..ddfd0cf76b318fbd9f333f66f730fc842ff4a0cb 100644
--- a/ui/events/devices/x11/touch_factory_x11.cc
+++ b/ui/events/devices/x11/touch_factory_x11.cc
@@ -103,6 +103,7 @@ void TouchFactory::UpdateDeviceList(Display* display) {
DeviceListCacheX11::GetInstance()->GetXI2DeviceList(display);
for (int i = 0; i < xi_dev_list.count; i++) {
const XIDeviceInfo& devinfo = xi_dev_list[i];
+ device_master_id_list_[devinfo.deviceid] = devinfo.attachment;
sadrul 2015/06/17 03:33:52 We should do this only for XISlavePointer device?
lanwei 2015/06/17 17:59:15 Done.
if (devinfo.use == XIFloatingSlave || devinfo.use == XIMasterPointer) {
for (int k = 0; k < devinfo.num_classes; ++k) {
XIAnyClassInfo* xiclassinfo = devinfo.classes[k];
@@ -130,6 +131,11 @@ void TouchFactory::UpdateDeviceList(Display* display) {
// Only care direct touch device (such as touch screen) right now
if (tci->mode == XIDirectTouch)
CacheTouchscreenIds(devinfo.deviceid);
+ // If the device is direct touch device, we also set its master
+ // device to be touch device.
+ touch_device_lookup_[device_master_id_list_[devinfo.deviceid]] =
+ true;
+ touch_device_list_[device_master_id_list_[devinfo.deviceid]] = true;
sadrul 2015/06/17 03:33:52 We should do this only for XISlavePointer? Also,
lanwei 2015/06/17 17:59:15 Done.
}
}
}
@@ -224,6 +230,10 @@ void TouchFactory::SetTouchDeviceList(const std::vector<int>& devices) {
DCHECK(IsValidDevice(*iter));
touch_device_lookup_[*iter] = true;
touch_device_list_[*iter] = false;
+ // When we set the device through the "--touch-devices" flag to touch
+ // device, we also set its master device to be touch device.
+ touch_device_lookup_[device_master_id_list_[*iter]] = true;
sadrul 2015/06/17 03:33:52 Check to see if |*iter| exists in |device_master_i
lanwei 2015/06/17 17:59:15 Done.
+ touch_device_list_[device_master_id_list_[*iter]] = false;
}
}
« no previous file with comments | « ui/events/devices/x11/touch_factory_x11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine