Re: [PATCH evdev] Write a SYN_REPORT after the last LED

2013-08-13 Thread Daniel Stone
Hi,

On 13 August 2013 06:29, Peter Hutterer peter.hutte...@who-t.net wrote:
 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.hutte...@who-t.net

Reviewed-by: Daniel Stone dan...@fooishbar.org

  src/evdev.c | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)

 diff --git a/src/evdev.c b/src/evdev.c
 index ba2a98c..456c7aa 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);
  }

 --
 1.8.2.1

 ___
 xorg-devel@lists.x.org: X.Org development
 Archives: http://lists.x.org/archives/xorg-devel
 Info: http://lists.x.org/mailman/listinfo/xorg-devel
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH evdev] Write a SYN_REPORT after the last LED

2013-08-12 Thread Peter Hutterer
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.hutte...@who-t.net
---
 src/evdev.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/evdev.c b/src/evdev.c
index ba2a98c..456c7aa 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);
 }
 
-- 
1.8.2.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel