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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 continue; | 553 continue; |
554 if (i == horizontal_number) { | 554 if (i == horizontal_number) { |
555 *x_offset = ExtractAndUpdateScrollOffset(&info->horizontal, *valuators); | 555 *x_offset = ExtractAndUpdateScrollOffset(&info->horizontal, *valuators); |
556 } else if (i == vertical_number) { | 556 } else if (i == vertical_number) { |
557 *y_offset = ExtractAndUpdateScrollOffset(&info->vertical, *valuators); | 557 *y_offset = ExtractAndUpdateScrollOffset(&info->vertical, *valuators); |
558 } | 558 } |
559 valuators++; | 559 valuators++; |
560 } | 560 } |
561 } | 561 } |
562 | 562 |
563 void DeviceDataManagerX11::InvalidateScrollClasses() { | 563 void DeviceDataManagerX11::InvalidateScrollClasses(int device_id) { |
564 for (int i = 0; i < kMaxDeviceNum; i++) { | 564 if (device_id == kAllDevices) { |
565 scroll_data_[i].horizontal.seen = false; | 565 for (int i = 0; i < kMaxDeviceNum; i++) { |
566 scroll_data_[i].vertical.seen = false; | 566 scroll_data_[i].horizontal.seen = false; |
| 567 scroll_data_[i].vertical.seen = false; |
| 568 } |
| 569 } else { |
| 570 CHECK(device_id >= 0 && device_id < kMaxDeviceNum); |
| 571 scroll_data_[device_id].horizontal.seen = false; |
| 572 scroll_data_[device_id].vertical.seen = false; |
567 } | 573 } |
568 } | 574 } |
569 | 575 |
570 void DeviceDataManagerX11::GetFlingData(const XEvent& xev, | 576 void DeviceDataManagerX11::GetFlingData(const XEvent& xev, |
571 float* vx, | 577 float* vx, |
572 float* vy, | 578 float* vy, |
573 float* vx_ordinal, | 579 float* vx_ordinal, |
574 float* vy_ordinal, | 580 float* vy_ordinal, |
575 bool* is_cancel) { | 581 bool* is_cancel) { |
576 *vx = 0; | 582 *vx = 0; |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 } else { | 890 } else { |
885 keyboards.erase(it); | 891 keyboards.erase(it); |
886 ++blocked_iter; | 892 ++blocked_iter; |
887 } | 893 } |
888 } | 894 } |
889 // Notify base class of updated list. | 895 // Notify base class of updated list. |
890 DeviceDataManager::OnKeyboardDevicesUpdated(keyboards); | 896 DeviceDataManager::OnKeyboardDevicesUpdated(keyboards); |
891 } | 897 } |
892 | 898 |
893 } // namespace ui | 899 } // namespace ui |
OLD | NEW |