Index: ui/events/ozone/evdev/input_device_factory_evdev.cc |
diff --git a/ui/events/ozone/evdev/input_device_factory_evdev.cc b/ui/events/ozone/evdev/input_device_factory_evdev.cc |
index 11a8f1e1f9641426798550e2736544aa302b694b..a909ba53c966e3d6c03f21103ae001f5961bc5ff 100644 |
--- a/ui/events/ozone/evdev/input_device_factory_evdev.cc |
+++ b/ui/events/ozone/evdev/input_device_factory_evdev.cc |
@@ -250,8 +250,8 @@ void InputDeviceFactoryEvdev::AttachInputDevice( |
ApplyCapsLockLed(); |
} |
- if (--pending_device_changes_ == 0) |
- NotifyDevicesUpdated(); |
+ --pending_device_changes_; |
+ NotifyDevicesUpdated(); |
} |
void InputDeviceFactoryEvdev::DetachInputDevice(const base::FilePath& path) { |
@@ -405,6 +405,8 @@ void InputDeviceFactoryEvdev::UpdateDirtyFlags( |
} |
void InputDeviceFactoryEvdev::NotifyDevicesUpdated() { |
+ if (pending_device_changes_) |
+ return; // No update until pending opens complete. |
if (touchscreen_list_dirty_) |
NotifyTouchscreensUpdated(); |
if (keyboard_list_dirty_) |