summaryrefslogtreecommitdiffstats
path: root/ui/events/x/device_data_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/events/x/device_data_manager.cc')
-rw-r--r--ui/events/x/device_data_manager.cc20
1 files changed, 1 insertions, 19 deletions
diff --git a/ui/events/x/device_data_manager.cc b/ui/events/x/device_data_manager.cc
index 9858ccc..d97b7f3 100644
--- a/ui/events/x/device_data_manager.cc
+++ b/ui/events/x/device_data_manager.cc
@@ -112,10 +112,8 @@ DeviceDataManager* DeviceDataManager::GetInstance() {
DeviceDataManager::DeviceDataManager()
: natural_scroll_enabled_(false),
- xi_opcode_(-1),
atom_cache_(gfx::GetXDisplay(), kCachedAtoms),
button_map_count_(0) {
- CHECK(gfx::GetXDisplay());
InitializeXInputInternal();
// Make sure the sizes of enum and kCachedAtoms are aligned.
@@ -136,6 +134,7 @@ bool DeviceDataManager::InitializeXInputInternal() {
VLOG(1) << "X Input extension not available: error=" << error;
return false;
}
+ xi_opcode_ = opcode;
// Check the XInput version.
#if defined(USE_XI2_MT)
@@ -147,16 +146,6 @@ bool DeviceDataManager::InitializeXInputInternal() {
VLOG(1) << "XInput2 not supported in the server.";
return false;
}
-#if defined(USE_XI2_MT)
- if (major < 2 || (major == 2 && minor < USE_XI2_MT)) {
- DVLOG(1) << "XI version on server is " << major << "." << minor << ". "
- << "But 2." << USE_XI2_MT << " is required.";
- return false;
- }
-#endif
-
- xi_opcode_ = opcode;
- CHECK_NE(-1, xi_opcode_);
// Possible XI event types for XIDeviceEvent. See the XI2 protocol
// specification.
@@ -174,10 +163,6 @@ bool DeviceDataManager::InitializeXInputInternal() {
return true;
}
-bool DeviceDataManager::IsXInput2Available() const {
- return xi_opcode_ != -1;
-}
-
float DeviceDataManager::GetNaturalScrollFactor(int sourceid) const {
// Natural scroll is touchpad-only.
if (sourceid >= kMaxDeviceNum || !touchpads_[sourceid])
@@ -207,9 +192,6 @@ void DeviceDataManager::UpdateDeviceList(Display* display) {
if (dev_list[i].type == xi_touchpad)
touchpads_[dev_list[i].id] = true;
- if (!IsXInput2Available())
- return;
-
// Update the structs with new valuator information
XIDeviceList info_list =
ui::DeviceListCacheX::GetInstance()->GetXI2DeviceList(display);