mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-07 23:42:02 +00:00
(submit/cleanup-xkb) xkb: ProcXkbGetDeviceInfo(): move button button action data into payload struct
Consolidate the button action data into the payload struct added by previous commit. So we can write it out (along with the name string) by just one call. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
16
xkb/xkb.c
16
xkb/xkb.c
@@ -6441,21 +6441,19 @@ ProcXkbGetDeviceInfo(ClientPtr client)
|
||||
|
||||
struct {
|
||||
char name[nameLen];
|
||||
xkbActionWireDesc actions[rep.nBtnsRtrn];
|
||||
} buf;
|
||||
|
||||
XkbWriteCountedString(buf.name, dev->name, client->swapped);
|
||||
if (rep.nBtnsRtrn > 0) {
|
||||
memcpy(buf.actions,
|
||||
&dev->button->xkb_acts[rep.firstBtnRtrn],
|
||||
sizeof(xkbActionWireDesc)*rep.nBtnsRtrn);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(buf), &buf);
|
||||
length -= sizeof(buf);
|
||||
|
||||
if (rep.nBtnsRtrn > 0) {
|
||||
int sz;
|
||||
xkbActionWireDesc *awire;
|
||||
|
||||
sz = rep.nBtnsRtrn * SIZEOF(xkbActionWireDesc);
|
||||
awire = (xkbActionWireDesc *) &dev->button->xkb_acts[rep.firstBtnRtrn];
|
||||
WriteToClient(client, sz, awire);
|
||||
length -= sz;
|
||||
}
|
||||
if (nDeviceLedFBs > 0) {
|
||||
status = SendDeviceLedFBs(dev, ledClass, ledID, length, client);
|
||||
if (status != Success)
|
||||
|
||||
Reference in New Issue
Block a user