OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/devices/x11/device_data_manager_x11.h" | 5 #include "ui/events/devices/x11/device_data_manager_x11.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <X11/extensions/XInput.h> | 8 #include <X11/extensions/XInput.h> |
9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
764 valuator_max_[deviceid][data_type] = valuator_class_info->max; | 764 valuator_max_[deviceid][data_type] = valuator_class_info->max; |
765 return IsCMTDataType(data_type); | 765 return IsCMTDataType(data_type); |
766 } | 766 } |
767 | 767 |
768 void DeviceDataManagerX11::UpdateScrollClassDevice( | 768 void DeviceDataManagerX11::UpdateScrollClassDevice( |
769 XIScrollClassInfo* scroll_class_info, | 769 XIScrollClassInfo* scroll_class_info, |
770 int deviceid) { | 770 int deviceid) { |
771 DCHECK(deviceid >= 0 && deviceid < kMaxDeviceNum); | 771 DCHECK(deviceid >= 0 && deviceid < kMaxDeviceNum); |
772 ScrollInfo& info = scroll_data_[deviceid]; | 772 ScrollInfo& info = scroll_data_[deviceid]; |
773 | 773 |
774 // xinput2 is disabled until edge cases are fixed. | |
775 bool xinput2_disabled = true; | |
776 if (xinput2_disabled) { | |
bokan
2016/06/29 18:34:24
No need for the variable and if statement. Just re
| |
777 return; | |
778 } | |
779 | |
774 bool legacy_scroll_available = | 780 bool legacy_scroll_available = |
775 (scroll_class_info->flags & XIScrollFlagNoEmulation) == 0; | 781 (scroll_class_info->flags & XIScrollFlagNoEmulation) == 0; |
776 // If the device's highest resolution is lower than the resolution of xinput1 | 782 // If the device's highest resolution is lower than the resolution of xinput1 |
777 // then use xinput1's events instead (ie. don't configure smooth scrolling). | 783 // then use xinput1's events instead (ie. don't configure smooth scrolling). |
778 if (legacy_scroll_available && | 784 if (legacy_scroll_available && |
779 std::abs(scroll_class_info->increment) <= 1.0) { | 785 std::abs(scroll_class_info->increment) <= 1.0) { |
780 return; | 786 return; |
781 } | 787 } |
782 | 788 |
783 switch (scroll_class_info->scroll_type) { | 789 switch (scroll_class_info->scroll_type) { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
880 } else { | 886 } else { |
881 keyboards.erase(it); | 887 keyboards.erase(it); |
882 ++blocked_iter; | 888 ++blocked_iter; |
883 } | 889 } |
884 } | 890 } |
885 // Notify base class of updated list. | 891 // Notify base class of updated list. |
886 DeviceDataManager::OnKeyboardDevicesUpdated(keyboards); | 892 DeviceDataManager::OnKeyboardDevicesUpdated(keyboards); |
887 } | 893 } |
888 | 894 |
889 } // namespace ui | 895 } // namespace ui |
OLD | NEW |