(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:
Enrico Weigelt, metux IT consult
2024-07-16 14:10:24 +02:00
parent 8439325a85
commit 0bcfe2f7f2

View File

@@ -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)