Commit dc7fb65d authored by Peter Hutterer's avatar Peter Hutterer

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's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 5561108a
......@@ -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;
}
......
......@@ -521,6 +521,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;
......@@ -528,6 +529,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:
......@@ -546,6 +548,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment