mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-11 22:40:25 +01:00
plugin: reset the filtered frame after sending it with buttons
Our filtered frame (frame without any button events) that gets passed down to here may include relative motion or other events. Once we use that frame to prepend the button event we need to reset it so we don't cause duplicate motion and/or events with zero delta timestamps. With the the previous code we got two identical frames: 42: event25: plugin button-debounce - 0.360 EV_MSC MSC_SCAN 30 ... event25: plugin button-debounce - 0.360 EV_KEY BTN_RIGHT 1 ... event25: plugin button-debounce - 0.360 EV_REL REL_X -7 ... event25: plugin button-debounce - 0.360 EV_REL REL_Y -7 ... event25: plugin button-debounce - 0.360 ----------------- EV_SYN ----------------- +8ms ... Plugin:button-debounce - debounce state: DEBOUNCE_STATE_IS_UP → DEBOUNCE_EVENT_OTHERBUTTON → DEBOUNCE_STATE_IS_UP ... Plugin:button-debounce - debounce state: DEBOUNCE_STATE_IS_UP → DEBOUNCE_EVENT_PRESS → DEBOUNCE_STATE_IS_DOWN_WAITING ... event25: plugin evdev - 0.360 EV_MSC MSC_SCAN 30 ... event25: plugin evdev - 0.360 EV_REL REL_X -7 ... event25: plugin evdev - 0.360 EV_REL REL_Y -7 ... event25: plugin evdev - 0.360 EV_KEY BTN_RIGHT 1 ... event25: plugin evdev - 0.360 ----------------- EV_SYN ----------------- +0ms ... Queuing event25 POINTER_MOTION +0.000s -7.00/ -7.00 ( -7.00/ -7.00) ... event25 - middlebutton state: MIDDLEBUTTON_IDLE → MIDDLEBUTTON_EVENT_R_DOWN → MIDDLEBUTTON_RIGHT_DOWN, rc 1 ... event25: plugin evdev - 0.360 EV_MSC MSC_SCAN 30 ... event25: plugin evdev - 0.360 EV_REL REL_X -7 ... event25: plugin evdev - 0.360 EV_REL REL_Y -7 ... event25: plugin evdev - 0.360 EV_KEY BTN_RIGHT 1 ... event25: plugin evdev - 0.360 ----------------- EV_SYN ----------------- +0ms ... Queuing event25 POINTER_MOTION +0.000s -nan/ -nan ( -7.00/ -7.00) event25 POINTER_MOTION +0.360s -7.00/ -7.00 ( -7.00/ -7.00) event25 POINTER_MOTION 2 +0.360s -nan/ -nan ( -7.00/ -7.00) The 0ms delta caused a -nan in the custom pointer accel but even without that bug the pointer would've jumped more than it should. Closes #1172 Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1301>
This commit is contained in:
parent
2f2bd357bc
commit
4d317eae17
1 changed files with 5 additions and 0 deletions
|
|
@ -283,6 +283,11 @@ debounce_notify_button(struct plugin_device *device,
|
|||
libinput_plugin_prepend_evdev_frame(device->parent->plugin,
|
||||
device->device,
|
||||
frame);
|
||||
|
||||
/* If we used the original frame, reset it to avoid re-sending any
|
||||
* non-button events that may be present in this frame */
|
||||
if (button_frame == NULL)
|
||||
evdev_frame_reset(frame);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue