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 5bf30b7029c81e9bb4bcefc8f9fbfcf06661d60e..a371dfa4670d860938e074bbf1aaf7f2e79d0f0f 100644 |
--- a/ui/events/ozone/evdev/input_device_factory_evdev.cc |
+++ b/ui/events/ozone/evdev/input_device_factory_evdev.cc |
@@ -21,6 +21,7 @@ |
#include "ui/events/ozone/evdev/device_event_dispatcher_evdev.h" |
#include "ui/events/ozone/evdev/event_converter_evdev_impl.h" |
#include "ui/events/ozone/evdev/event_device_info.h" |
+#include "ui/events/ozone/evdev/palm_suppression_filter.h" |
#include "ui/events/ozone/evdev/tablet_event_converter_evdev.h" |
#include "ui/events/ozone/evdev/touch_event_converter_evdev.h" |
@@ -185,6 +186,7 @@ InputDeviceFactoryEvdev::InputDeviceFactoryEvdev( |
gesture_property_provider_(new GesturePropertyProvider), |
#endif |
dispatcher_(std::move(dispatcher)), |
+ palm_filter_(new PalmSuppressionFilter(dispatcher_.get())), |
weak_ptr_factory_(this) { |
} |
@@ -342,20 +344,34 @@ void InputDeviceFactoryEvdev::ApplyInputDeviceSettings() { |
SetBoolPropertyForOneType(DT_TOUCHPAD, "Tap Paused", |
input_device_settings_.tap_to_click_paused); |
+ EventConverterEvdev* internal_pen = nullptr; |
+ EventConverterEvdev* internal_touch = 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); |
+ converter->SetPalmSuppressionFilter(nullptr); |
+ |
+ if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL) { |
+ if (converter->HasKeyboard()) { |
+ converter->SetKeyFilter( |
+ input_device_settings_.enable_internal_keyboard_filter, |
+ input_device_settings_.internal_keyboard_allowed_keys); |
+ } |
+ if (converter->HasPen()) { |
+ internal_pen = converter; |
+ } else if (converter->HasTouchscreen()) { |
+ internal_touch = converter; |
+ } |
} |
converter->SetTouchEventLoggingEnabled( |
input_device_settings_.touch_event_logging_enabled); |
} |
+ |
+ if (internal_touch && internal_pen) { |
+ internal_touch->SetPalmSuppressionFilter(palm_filter_.get()); |
+ internal_pen->SetPalmSuppressionFilter(palm_filter_.get()); |
+ } |
} |
void InputDeviceFactoryEvdev::ApplyCapsLockLed() { |