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 "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" | 5 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" |
6 | 6 |
7 #include <X11/extensions/XInput2.h> | 7 #include <X11/extensions/XInput2.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 device_data_manager->DisableDevice(touchpad_device_id_); | 91 device_data_manager->DisableDevice(touchpad_device_id_); |
92 Shell::GetInstance()->cursor_manager()->HideCursor(); | 92 Shell::GetInstance()->cursor_manager()->HideCursor(); |
93 } | 93 } |
94 } else if (device_name == kCoreKeyboardName) { | 94 } else if (device_name == kCoreKeyboardName) { |
95 core_keyboard_device_id_ = xi_dev_list[i].deviceid; | 95 core_keyboard_device_id_ = xi_dev_list[i].deviceid; |
96 device_data_manager->DisableDevice(core_keyboard_device_id_); | 96 device_data_manager->DisableDevice(core_keyboard_device_id_); |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 for (const ui::InputDevice& device : | 100 for (const ui::InputDevice& device : |
101 device_data_manager->keyboard_devices()) { | 101 device_data_manager->GetKeyboardDevices()) { |
102 if (device.type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL) { | 102 if (device.type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL) { |
103 keyboard_device_id_ = device.id; | 103 keyboard_device_id_ = device.id; |
104 device_data_manager->DisableDevice(keyboard_device_id_); | 104 device_data_manager->DisableDevice(keyboard_device_id_); |
105 break; | 105 break; |
106 } | 106 } |
107 } | 107 } |
108 } | 108 } |
109 // Allow the accessible keys present on the side of some devices to continue | 109 // Allow the accessible keys present on the side of some devices to continue |
110 // working. | 110 // working. |
111 std::unique_ptr<std::set<ui::KeyboardCode>> excepted_keys( | 111 std::unique_ptr<std::set<ui::KeyboardCode>> excepted_keys( |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // blocked. Move the mouse cursor back to its last known location resulting | 159 // blocked. Move the mouse cursor back to its last known location resulting |
160 // from an external mouse to prevent the internal touchpad from moving it. | 160 // from an external mouse to prevent the internal touchpad from moving it. |
161 SetMouseLocationInScreen(last_mouse_location_); | 161 SetMouseLocationInScreen(last_mouse_location_); |
162 } else { | 162 } else { |
163 // Track the last location seen from an external mouse event. | 163 // Track the last location seen from an external mouse event. |
164 last_mouse_location_ = GetMouseLocationInScreen(); | 164 last_mouse_location_ = GetMouseLocationInScreen(); |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 } // namespace ash | 168 } // namespace ash |
OLD | NEW |