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 95f3867bc1d19a769da09e576096e9018d42d1e3..c810de36dd488fb279592d11a3348451224460ad 100644 |
--- a/ui/events/ozone/evdev/input_device_factory_evdev.cc |
+++ b/ui/events/ozone/evdev/input_device_factory_evdev.cc |
@@ -342,20 +342,34 @@ void InputDeviceFactoryEvdev::ApplyInputDeviceSettings() { |
SetBoolPropertyForOneType(DT_TOUCHPAD, "Tap Paused", |
input_device_settings_.tap_to_click_paused); |
+ EventConverterEvdev* internal_pen = nullptr; |
for (const auto& it : converters_) { |
EventConverterEvdev* converter = it.second; |
- converter->SetEnabled(IsDeviceEnabled(converter)); |
- |
- if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL && |
- converter->HasKeyboard()) { |
- converter->SetKeyFilter( |
- input_device_settings_.enable_internal_keyboard_filter, |
- input_device_settings_.internal_keyboard_allowed_keys); |
+ bool enabled = IsDeviceEnabled(converter); |
+ |
+ if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL) { |
+ if (converter->HasPen()) { |
+ converter->SetPalmSuppressionCallback(base::Callback<void(bool)>()); |
spang
2016/08/26 00:58:34
This call isn't conditional on settings, can you d
denniskempin
2016/08/26 21:56:02
Done.
I was a little paranoid about the theoretic
|
+ internal_pen = converter; |
+ } else if (converter->HasTouchscreen()) { |
+ enabled &= !palm_suppression_enabled_; |
+ } |
+ |
+ if (converter->HasKeyboard()) { |
+ converter->SetKeyFilter( |
+ input_device_settings_.enable_internal_keyboard_filter, |
+ input_device_settings_.internal_keyboard_allowed_keys); |
+ } |
} |
- |
+ converter->SetEnabled(enabled); |
converter->SetTouchEventLoggingEnabled( |
input_device_settings_.touch_event_logging_enabled); |
} |
+ if (internal_pen) { |
+ internal_pen->SetPalmSuppressionCallback( |
spang
2016/08/26 00:58:34
Also this one. Unless it uses settings, it doesn't
denniskempin
2016/08/26 21:56:02
Done.
|
+ base::Bind(&InputDeviceFactoryEvdev::EnablePalmSuppression, |
+ base::Unretained(this))); |
+ } |
} |
void InputDeviceFactoryEvdev::ApplyCapsLockLed() { |
@@ -491,4 +505,19 @@ void InputDeviceFactoryEvdev::SetBoolPropertyForOneType( |
#endif |
} |
+void InputDeviceFactoryEvdev::EnablePalmSuppression(bool enabled) { |
+ if (enabled == palm_suppression_enabled_) |
+ return; |
+ |
+ for (const auto& it : converters_) { |
+ EventConverterEvdev* converter = it.second; |
+ if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL && |
+ converter->HasTouchscreen() && !converter->HasPen()) { |
+ converter->SetEnabled(!enabled); |
spang
2016/08/26 00:58:34
The way to disable a device is to change the imple
denniskempin
2016/08/26 21:56:02
Done.
|
+ } |
+ } |
+ |
+ palm_suppression_enabled_ = enabled; |
+} |
+ |
} // namespace ui |