OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/ozone/evdev/input_device_factory_evdev.h" | 5 #include "ui/events/ozone/evdev/input_device_factory_evdev.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <linux/input.h> | 8 #include <linux/input.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 SetIntPropertyForOneType(DT_MOUSE, "Pointer Sensitivity", | 313 SetIntPropertyForOneType(DT_MOUSE, "Pointer Sensitivity", |
314 input_device_settings_.mouse_sensitivity); | 314 input_device_settings_.mouse_sensitivity); |
315 SetIntPropertyForOneType(DT_MOUSE, "Scroll Sensitivity", | 315 SetIntPropertyForOneType(DT_MOUSE, "Scroll Sensitivity", |
316 input_device_settings_.mouse_sensitivity); | 316 input_device_settings_.mouse_sensitivity); |
317 | 317 |
318 SetBoolPropertyForOneType(DT_TOUCHPAD, "Tap Paused", | 318 SetBoolPropertyForOneType(DT_TOUCHPAD, "Tap Paused", |
319 input_device_settings_.tap_to_click_paused); | 319 input_device_settings_.tap_to_click_paused); |
320 | 320 |
321 for (const auto& it : converters_) { | 321 for (const auto& it : converters_) { |
322 EventConverterEvdev* converter = it.second.get(); | 322 EventConverterEvdev* converter = it.second.get(); |
| 323 // The device was activated/deactivated we need to notify so |
| 324 // Interactions MQs can be updated. |
| 325 if (converter->IsEnabled() != IsDeviceEnabled(converter)) |
| 326 UpdateDirtyFlags(converter); |
323 converter->SetEnabled(IsDeviceEnabled(converter)); | 327 converter->SetEnabled(IsDeviceEnabled(converter)); |
324 | 328 |
325 if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL && | 329 if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL && |
326 converter->HasKeyboard()) { | 330 converter->HasKeyboard()) { |
327 converter->SetKeyFilter( | 331 converter->SetKeyFilter( |
328 input_device_settings_.enable_internal_keyboard_filter, | 332 input_device_settings_.enable_internal_keyboard_filter, |
329 input_device_settings_.internal_keyboard_allowed_keys); | 333 input_device_settings_.internal_keyboard_allowed_keys); |
330 } | 334 } |
331 | 335 |
332 converter->SetTouchEventLoggingEnabled( | 336 converter->SetTouchEventLoggingEnabled( |
333 input_device_settings_.touch_event_logging_enabled); | 337 input_device_settings_.touch_event_logging_enabled); |
334 } | 338 } |
| 339 NotifyDevicesUpdated(); |
335 } | 340 } |
336 | 341 |
337 void InputDeviceFactoryEvdev::ApplyCapsLockLed() { | 342 void InputDeviceFactoryEvdev::ApplyCapsLockLed() { |
338 for (const auto& it : converters_) { | 343 for (const auto& it : converters_) { |
339 EventConverterEvdev* converter = it.second.get(); | 344 EventConverterEvdev* converter = it.second.get(); |
340 converter->SetCapsLockLed(caps_lock_led_enabled_); | 345 converter->SetCapsLockLed(caps_lock_led_enabled_); |
341 } | 346 } |
342 } | 347 } |
343 | 348 |
344 bool InputDeviceFactoryEvdev::IsDeviceEnabled( | 349 bool InputDeviceFactoryEvdev::IsDeviceEnabled( |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 if (enabled == palm_suppression_enabled_) | 501 if (enabled == palm_suppression_enabled_) |
497 return; | 502 return; |
498 palm_suppression_enabled_ = enabled; | 503 palm_suppression_enabled_ = enabled; |
499 | 504 |
500 for (const auto& it : converters_) { | 505 for (const auto& it : converters_) { |
501 it.second->SetEnabled(IsDeviceEnabled(it.second.get())); | 506 it.second->SetEnabled(IsDeviceEnabled(it.second.get())); |
502 } | 507 } |
503 } | 508 } |
504 | 509 |
505 } // namespace ui | 510 } // namespace ui |
OLD | NEW |