| Index: ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc
|
| diff --git a/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc
|
| index 6b14045ef3971755faa9211b6399e2dd32bee03f..cfe840bff2298ead9c8402737e749a3ea1d72b20 100644
|
| --- a/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc
|
| +++ b/ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc
|
| @@ -19,6 +19,8 @@
|
| #include "ui/aura/window.h"
|
| #include "ui/aura/window_event_dispatcher.h"
|
| #include "ui/aura/window_tree_host.h"
|
| +#include "ui/events/devices/input_device.h"
|
| +#include "ui/events/devices/keyboard_device.h"
|
| #include "ui/events/devices/x11/device_data_manager_x11.h"
|
| #include "ui/events/devices/x11/device_list_cache_x11.h"
|
| #include "ui/events/event.h"
|
| @@ -34,9 +36,6 @@ namespace {
|
| // The name of the xinput device corresponding to the internal touchpad.
|
| const char kInternalTouchpadName[] = "Elan Touchpad";
|
|
|
| -// The name of the xinput device corresponding to the internal keyboard.
|
| -const char kInternalKeyboardName[] = "AT Translated Set 2 keyboard";
|
| -
|
| // Repeated key events have their source set to the core keyboard device.
|
| // These must be disabled also until http://crbug.com/402898 is resolved.
|
| const char kCoreKeyboardName[] = "Virtual core keyboard";
|
| @@ -86,14 +85,20 @@ ScopedDisableInternalMouseAndKeyboardX11::
|
| device_data_manager->DisableDevice(touchpad_device_id_);
|
| aura::client::GetCursorClient(
|
| Shell::GetInstance()->GetPrimaryRootWindow())->HideCursor();
|
| - } else if (device_name == kInternalKeyboardName) {
|
| - keyboard_device_id_ = xi_dev_list[i].deviceid;
|
| - device_data_manager->DisableDevice(keyboard_device_id_);
|
| } else if (device_name == kCoreKeyboardName) {
|
| core_keyboard_device_id_ = xi_dev_list[i].deviceid;
|
| device_data_manager->DisableDevice(core_keyboard_device_id_);
|
| }
|
| }
|
| +
|
| + for (const ui::KeyboardDevice& device :
|
| + device_data_manager->keyboard_devices()) {
|
| + if (device.type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL) {
|
| + keyboard_device_id_ = device.id;
|
| + device_data_manager->DisableDevice(keyboard_device_id_);
|
| + break;
|
| + }
|
| + }
|
| }
|
| // Allow the accessible keys present on the side of some devices to continue
|
| // working.
|
|
|