Lifting the eraser button on prox-out causes a fake pen proximity in event
Recording found here. The troubling event sequence is
E: 0.162026 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +7ms
E: 0.191455 0001 014a 0000 # EV_KEY / BTN_TOUCH 0
E: 0.191455 0003 0000 5333 # EV_ABS / ABS_X 5333
E: 0.191455 0003 0001 5478 # EV_ABS / ABS_Y 5478
E: 0.191455 0003 0018 0000 # EV_ABS / ABS_PRESSURE 0
E: 0.191455 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +29ms
E: 0.193190 0001 0141 0000 # EV_KEY / BTN_TOOL_RUBBER 0
E: 0.193190 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +2ms
E: 0.193215 0001 0140 0001 # EV_KEY / BTN_TOOL_PEN 1
E: 0.193215 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +0ms
E: 0.194670 0001 0140 0000 # EV_KEY / BTN_TOOL_PEN 0
E: 0.194670 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +1ms
Which results in
event22 TABLET_TOOL_TIP +2.46s 133.32*/114.12* pressure: 0.00* up
event22 TABLET_TOOL_PROXIMITY +2.46s 133.32/114.12 pressure: 0.00 eraser (0, id 0) proximity-out
event22 TABLET_TOOL_PROXIMITY +2.46s 133.32*/114.12* pressure: 0.00* pen (0, id 0) proximity-in axes:pbtn:S
event22 TABLET_TOOL_PROXIMITY +2.46s 133.32/114.12 pressure: 0.00 pen (0, id 0) proximity-out
libinput should put a timer on the eraser proximity out and paper over any proximity in events. This will skip the extra pen proximity in event. This only affects the eraser->pen transition as it is triggered by a button press. Looks like the times between are short enough that the timeout can be small.
That recording has a second event sequence (the last one) where the BTN_TOOL_PEN 1
event comes with axis updates, but 0ms after the BTN_TOOL_RUBBER 0
event. So we can't filter by "do we have an axis update?", this really needs to be a timeout.