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

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

Issue 1792623003: Changed DeviceDataManagerX11 to use xinput1 for low resolution scroll devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made code more readable Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/devices/x11/device_data_manager_x11.cc
diff --git a/ui/events/devices/x11/device_data_manager_x11.cc b/ui/events/devices/x11/device_data_manager_x11.cc
index 9d83afe1e34c98dbdaa8e91337c4b4818b295d6e..580e7dd9fc13d42e2fddbe37df985c565df6fa4e 100644
--- a/ui/events/devices/x11/device_data_manager_x11.cc
+++ b/ui/events/devices/x11/device_data_manager_x11.cc
@@ -771,6 +771,16 @@ void DeviceDataManagerX11::UpdateScrollClassDevice(
int deviceid) {
DCHECK(deviceid >= 0 && deviceid < kMaxDeviceNum);
ScrollInfo& info = scroll_data_[deviceid];
+
+ bool legacy_scroll_available =
+ (scroll_class_info->flags & XIScrollFlagNoEmulation) == 0;
+ // If the device's highest resolution is lower than the resolution of xinput1
+ // then use that.
sadrul 2016/04/22 02:42:23 s/then use that/then use the xinput1 resolution in
Will Shackleton 2016/04/22 14:56:55 Done.
+ if (legacy_scroll_available &&
+ std::abs(scroll_class_info->increment) <= 1.0) {
+ return;
sadrul 2016/04/22 02:42:22 Does this need to reset some state of |info|?
Will Shackleton 2016/04/22 14:56:55 No - the |info| fields are reset upon call to this
+ }
+
switch (scroll_class_info->scroll_type) {
case XIScrollTypeVertical:
info.vertical.number = scroll_class_info->number;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698