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.hutte...@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

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to