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

Unified Diff: chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.cc

Issue 8356040: Reapply Caps Lock and Num Lock to core keyboard whenever new X input device is added (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move chrome_browser_main_chromeos.cc to an another CL Created 9 years, 1 month 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
Index: chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.cc
diff --git a/chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.cc b/chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.cc
index 9e30df3e86adeee8edc9cab844fbb3fb8bd677a8..1af7898ad6469d5bfb30baf63db964e48bce2942 100644
--- a/chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.cc
+++ b/chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.cc
@@ -45,13 +45,18 @@ void SelectXInputEvents() {
// Checks the |event| and asynchronously sets the XKB layout when necessary.
void HandleHierarchyChangedEvent(XIHierarchyEvent* event) {
+ if (!(event->flags & XISlaveAdded)) {
+ return;
+ }
for (int i = 0; i < event->num_info; ++i) {
XIHierarchyInfo* info = &event->info[i];
- if ((event->flags & XISlaveAdded) &&
- (info->use == XIFloatingSlave) &&
- (info->flags & XISlaveAdded)) {
- chromeos::input_method::InputMethodManager::GetInstance()->
- GetXKeyboard()->ReapplyCurrentKeyboardLayout();
+ if ((info->flags & XISlaveAdded) && (info->use == XIFloatingSlave)) {
+ chromeos::input_method::InputMethodManager* input_method_manager =
+ chromeos::input_method::InputMethodManager::GetInstance();
+ chromeos::input_method::XKeyboard* xkeyboard =
+ input_method_manager->GetXKeyboard();
+ xkeyboard->ReapplyCurrentModifierLockStatus();
+ xkeyboard->ReapplyCurrentKeyboardLayout();
break;
}
}
« no previous file with comments | « chrome/browser/chromeos/system_key_event_listener.cc ('k') | chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698