[PATCH libinput 2/8] tablet: move the quirk disabling up within tablet_init

Peter Hutterer peter.hutterer at who-t.net
Wed Feb 7 01:45:00 UTC 2018


Let's make sure all libevdev manipluations are done before we start
initializing anything based on the event codes.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-tablet.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index 2f6b64da..054c529e 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -2012,6 +2012,12 @@ tablet_init(struct tablet_dispatch *tablet,
 	if (tablet_reject_device(device))
 		return -1;
 
+	if (!libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_PEN)) {
+		libevdev_enable_event_code(evdev, EV_KEY, BTN_TOOL_PEN, NULL);
+		want_proximity_quirk = true;
+		tablet->quirks.proximity_out_forced = true;
+	}
+
 	tablet_init_calibration(tablet, device);
 	tablet_init_proximity_threshold(tablet, device);
 	rc = tablet_init_accel(tablet, device);
@@ -2029,12 +2035,6 @@ tablet_init(struct tablet_dispatch *tablet,
 
 	tablet_set_status(tablet, TABLET_TOOL_OUT_OF_PROXIMITY);
 
-	if (!libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_PEN)) {
-		libevdev_enable_event_code(evdev, EV_KEY, BTN_TOOL_PEN, NULL);
-		want_proximity_quirk = true;
-		tablet->quirks.proximity_out_forced = true;
-	}
-
 	if (device->model_flags & EVDEV_MODEL_TABLET_NO_PROXIMITY_OUT)
 		want_proximity_quirk = true;
 
-- 
2.14.3



More information about the wayland-devel mailing list