diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2017-11-13 13:29:00 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2017-11-28 12:44:41 +1000 |
commit | 01ae8bd6a27c13bffb834e2c38bc2714182fb93d (patch) | |
tree | c7ffe408aad38e229b197251f10623dbacd9e5b9 | |
parent | c24c2af560a6682c3c0671ea712771a631f851f5 (diff) |
touchpad: post a SYN_REPORT after a faked trackpoint button
This has no real effect at the moment because the fallback interface doesn't
care much about SYN_REPORT, it processes events as they come in. But it's a
bug nonetheless, the process() callback expects correct event frames.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit dc7fb65db5ff80612fab83d0bdcadd99d55edff8)
-rw-r--r-- | src/evdev-mt-touchpad-buttons.c | 6 | ||||
-rw-r--r-- | src/evdev-mt-touchpad.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c index 8c374345..a0ecefd2 100644 --- a/src/evdev-mt-touchpad-buttons.c +++ b/src/evdev-mt-touchpad-buttons.c @@ -1055,15 +1055,21 @@ tp_notify_clickpadbutton(struct tp_dispatch *tp, if (is_topbutton && tp->buttons.trackpoint) { struct evdev_dispatch *dispatch = tp->buttons.trackpoint->dispatch; struct input_event event; + struct input_event syn_report = {{ 0, 0 }, EV_SYN, SYN_REPORT, 0 }; event.time = us2tv(time); event.type = EV_KEY; event.code = button; event.value = (state == LIBINPUT_BUTTON_STATE_PRESSED) ? 1 : 0; + syn_report.time = event.time; dispatch->interface->process(dispatch, tp->buttons.trackpoint, &event, time); + dispatch->interface->process(dispatch, + tp->buttons.trackpoint, + &syn_report, + time); return 1; } diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 749f9413..8393bece 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -502,6 +502,7 @@ tp_process_trackpoint_button(struct tp_dispatch *tp, { struct evdev_dispatch *dispatch; struct input_event event; + struct input_event syn_report = {{ 0, 0 }, EV_SYN, SYN_REPORT, 0 }; if (!tp->buttons.trackpoint) return; @@ -509,6 +510,7 @@ tp_process_trackpoint_button(struct tp_dispatch *tp, dispatch = tp->buttons.trackpoint->dispatch; event = *e; + syn_report.time = e->time; switch (event.code) { case BTN_0: @@ -527,6 +529,9 @@ tp_process_trackpoint_button(struct tp_dispatch *tp, dispatch->interface->process(dispatch, tp->buttons.trackpoint, &event, time); + dispatch->interface->process(dispatch, + tp->buttons.trackpoint, + &syn_report, time); } static void |