diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-04-29 18:39:34 -0700 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-04-30 11:51:00 +1000 |
commit | bb82c72a1d69eaf60b7586570faf797df967f661 (patch) | |
tree | baf2b4d989758ccdc736559ac3993152616ae8e8 /src | |
parent | 26cb4573cbb8808ce9d5c75c16bd613b2f03a368 (diff) |
Expand comment on the memory vs. reply ordering in XIGetSelectedEvents()
Unpacking from the wire involves un-interleaving the structs & masks,
which wasn't obvious to me the first time I read it, so make notes
before I forget again.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/XISelEv.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/XISelEv.c b/src/XISelEv.c index fa7eb54..f871222 100644 --- a/src/XISelEv.c +++ b/src/XISelEv.c @@ -135,8 +135,14 @@ XIGetSelectedEvents(Display* dpy, Window win, int *num_masks_return) _XRead(dpy, (char*)mask_in, reply.length * 4); - /* Memory layout of the XIEventMask for a 3 mask reply: - * [struct a][struct b][struct c][masks a][masks b][masks c] + /* + * This function takes interleaved xXIEventMask structs & masks off + * the wire, such as this 3 mask reply: + * [struct a][masks a][struct b][masks b][struct c][masks c] + * And generates a memory buffer to be returned to callers in which + * they are not interleaved, so that callers can treat the returned + * pointer as a simple array of XIEventMask structs, such as: + * [struct a][struct b][struct c][masks a][masks b][masks c] */ len = reply.num_masks * sizeof(XIEventMask); |