| 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;
|
| }
|
| }
|
|
|