Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Unified Diff: ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc

Issue 1023743002: Merge Disable Keyboard in Maximize Mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2311
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/events/platform/x11/x11_hotplug_event_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | ui/events/platform/x11/x11_hotplug_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698