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

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

Issue 2153683002: Added a command line switch to disable xinput2, enabled xinput2 by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed ui_events_devices_x11_switches files Created 4 years, 5 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 | « ui/events/devices/x11/device_data_manager_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/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 51927e4327be15081838d9b071b033260d4c7260..a64abc6e6a4fd81dfc0a4e2984e9b21eb797b216 100644
--- a/ui/events/devices/x11/device_data_manager_x11.cc
+++ b/ui/events/devices/x11/device_data_manager_x11.cc
@@ -13,6 +13,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/singleton.h"
@@ -124,6 +125,15 @@ Iterator FindDeviceWithId(Iterator begin, Iterator end, int id) {
return end;
}
+// Disables high precision scrolling in X11
+const char kDisableHighPrecisionScrolling[] =
+ "disable-high-precision-scrolling";
+
+bool IsHighPrecisionScrollingDisabled() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ kDisableHighPrecisionScrolling);
+}
+
} // namespace
bool DeviceDataManagerX11::IsCMTDataType(const int type) {
@@ -155,6 +165,7 @@ DeviceDataManagerX11* DeviceDataManagerX11::GetInstance() {
DeviceDataManagerX11::DeviceDataManagerX11()
: xi_opcode_(-1),
+ high_precision_scrolling_disabled_(IsHighPrecisionScrollingDisabled()),
atom_cache_(gfx::GetXDisplay(), kCachedAtoms),
button_map_count_(0) {
CHECK(gfx::GetXDisplay());
@@ -768,13 +779,12 @@ bool DeviceDataManagerX11::UpdateValuatorClassDevice(
void DeviceDataManagerX11::UpdateScrollClassDevice(
XIScrollClassInfo* scroll_class_info,
int deviceid) {
+ if (high_precision_scrolling_disabled_)
+ return;
+
DCHECK(deviceid >= 0 && deviceid < kMaxDeviceNum);
ScrollInfo& info = scroll_data_[deviceid];
- // TODO: xinput2 is disabled until edge cases are fixed.
- // http://crbug.com/616308
- return;
-
bool legacy_scroll_available =
(scroll_class_info->flags & XIScrollFlagNoEmulation) == 0;
// If the device's highest resolution is lower than the resolution of xinput1
« no previous file with comments | « ui/events/devices/x11/device_data_manager_x11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698