Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Unified Diff: ui/events/ozone/evdev/input_device_factory_evdev.cc

Issue 2263693003: Add palm suppression feature to EventConverterEvdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stylus
Patch Set: use touch major = max to recognize palms Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..4ecca03e6cd25bfc554aab752eb56f7e68d252dc 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() {

Powered by Google App Engine
This is Rietveld 408576698