aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-08-13 14:44:26 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-10-07 09:22:50 +1100
commitf285567d372514d31096cc25a467d5d2e182885a (patch)
tree4a560330c5305db591298c00c82518b8ac457186
parentMap REL_DIAL to vertical scrolling (diff)
downloadxf86-input-evdev-f285567d372514d31096cc25a467d5d2e182885a.tar.gz
xf86-input-evdev-f285567d372514d31096cc25a467d5d2e182885a.tar.bz2
xf86-input-evdev-f285567d372514d31096cc25a467d5d2e182885a.zip
Write a SYN_REPORT after the last LED
When writing LED values to the device, append a SYN_REPORT to the list to ensure other clients are updated immediately. Otherwise, the LED events will be queued and not sent to other clients until the next input event arrives. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> (cherry picked from commit 27926b3763e525470ec8e4ac9a97aa0e02f1dd95)
-rw-r--r--src/evdev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c
index d36eb54..af4aba3 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1157,7 +1157,7 @@ EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl)
};
InputInfoPtr pInfo;
- struct input_event ev[ArrayLength(bits)];
+ struct input_event ev[ArrayLength(bits) + 1];
int i;
memset(ev, 0, sizeof(ev));
@@ -1169,6 +1169,10 @@ EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl)
ev[i].value = (ctrl->leds & bits[i].xbit) > 0;
}
+ ev[i].type = EV_SYN;
+ ev[i].code = SYN_REPORT;
+ ev[i].value = 0;
+
write(pInfo->fd, ev, sizeof ev);
}