diff --git a/dix/devices.c b/dix/devices.c index 6f66b3d10..8d0c48784 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1760,7 +1760,6 @@ BadDeviceMap(BYTE * buff, int length, unsigned low, unsigned high, XID *errval) int ProcSetModifierMapping(ClientPtr client) { - xSetModifierMappingReply rep; int rc; REQUEST(xSetModifierMappingReq); @@ -1770,11 +1769,6 @@ ProcSetModifierMapping(ClientPtr client) bytes_to_int32(sizeof(xSetModifierMappingReq)))) return BadLength; - rep = (xSetModifierMappingReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0 - }; rc = change_modmap(client, PickKeyboard(client), (KeyCode *) &stuff[1], stuff->numKeyPerModifier); @@ -1783,9 +1777,17 @@ ProcSetModifierMapping(ClientPtr client) if (rc != MappingSuccess && rc != MappingFailed && rc != MappingBusy) return rc; - rep.success = rc; + xSetModifierMappingReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .success = rc, + }; - WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep); + if (client->swapped) { + swaps(&rep.sequenceNumber); + } + WriteToClient(client, sizeof(rep), &rep); return Success; } diff --git a/dix/tables.c b/dix/tables.c index 99085c7dd..814e8cd45 100644 --- a/dix/tables.c +++ b/dix/tables.c @@ -831,7 +831,7 @@ ReplySwapPtr ReplySwapVector[256] = { ReplyNotSwappd, /* 115 */ (ReplySwapPtr) SGenericReply, /* SetPointerMapping */ (ReplySwapPtr) SGetPointerMappingReply, - (ReplySwapPtr) SGenericReply, /* SetModifierMapping */ + ReplyNotSwappd, (ReplySwapPtr) SGetModifierMappingReply, /* 119 */ ReplyNotSwappd, /* 120 */ ReplyNotSwappd, /* 121 */