Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: ui/events/ozone/evdev/input_device_factory_evdev.cc

Issue 1048333005: ozone: Map TouchEvent::touch_id_ into expected range (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/events/ozone/evdev/input_device_factory_evdev.cc
diff --git a/ui/events/ozone/evdev/input_device_factory_evdev.cc b/ui/events/ozone/evdev/input_device_factory_evdev.cc
index 988047ba7097a004ea7d9977fc0ba8585028f743..02af807fa70d3c49014147968203e49a9705710b 100644
--- a/ui/events/ozone/evdev/input_device_factory_evdev.cc
+++ b/ui/events/ozone/evdev/input_device_factory_evdev.cc
@@ -191,6 +191,7 @@ InputDeviceFactoryEvdev::InputDeviceFactoryEvdev(
mouse_list_dirty_(false),
touchpad_list_dirty_(false),
caps_lock_led_enabled_(false),
+ next_touch_id_offset_(0),
weak_ptr_factory_(this) {
}
@@ -245,6 +246,9 @@ void InputDeviceFactoryEvdev::AttachInputDevice(
converters_[path]->Start();
UpdateDirtyFlags(converters_[path]);
+ // Setup touch event id offsets.
+ ApplyTouchIdOffset(converters_[path]);
+
// Sync settings to new device.
ApplyInputDeviceSettings();
ApplyCapsLockLed();
@@ -389,6 +393,14 @@ void InputDeviceFactoryEvdev::ApplyCapsLockLed() {
}
}
+void InputDeviceFactoryEvdev::ApplyTouchIdOffset(
+ EventConverterEvdev* converter) {
+ if (converter->HasTouchscreen()) {
+ converter->SetTouchIdOffset(next_touch_id_offset_);
+ next_touch_id_offset_ += converter->GetTouchPoints();
+ }
+}
+
void InputDeviceFactoryEvdev::UpdateDirtyFlags(
const EventConverterEvdev* converter) {
if (converter->HasTouchscreen())

Powered by Google App Engine
This is Rietveld 408576698