int state;
uint32_t doubled_up_new_tool_bit = 0;
+ /* we were already out of proximity but now got a tool update but
+ * our tool state is zero - i.e. we got a valid prox out from the
+ * device.
+ */
+ if (tablet->quirks.proximity_out_forced &&
+ tablet_has_status(tablet, TABLET_TOOL_UPDATED) &&
+ !tablet->tool_state) {
+ tablet->quirks.need_to_force_prox_out = false;
+ tablet->quirks.proximity_out_forced = false;
+ }
/* We need to emulate a BTN_TOOL_PEN if we get an axis event (i.e.
* stylus is def. in proximity) and:
* - we forced a proximity out before, or
LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT);
}
- litest_push_event_frame(dev);
- litest_tablet_proximity_out(dev);
- litest_event(dev, EV_KEY, BTN_TOOL_PEN, 0);
- litest_event(dev, EV_SYN, SYN_REPORT, 0);
- litest_pop_event_frame(dev);
-
litest_tablet_proximity_in(dev, 50, 50, NULL);
libinput_dispatch(li);
litest_assert_tablet_proximity_event(li,
LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN);
- libinput_dispatch(li);
for (i = 0; i < 10; i++) {
litest_tablet_motion(dev, 50 + i, 50 + i, NULL);
litest_assert_only_typed_events(li,
LIBINPUT_EVENT_TABLET_TOOL_AXIS);
+ libinput_dispatch(li);
+ litest_timeout_tablet_proxout();
+ libinput_dispatch(li);
+
+ litest_assert_empty_queue(li);
+
litest_push_event_frame(dev);
litest_tablet_proximity_out(dev);
litest_event(dev, EV_KEY, BTN_TOOL_PEN, 0);