diff --git a/Xext/saver.c b/Xext/saver.c index 4d9e6b974..c27a66c80 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -1209,17 +1209,26 @@ static int ProcScreenSaverSuspend(ClientPtr client) { ScreenSaverSuspensionPtr *prev, this; + BOOL suspend; REQUEST(xScreenSaverSuspendReq); REQUEST_SIZE_MATCH(xScreenSaverSuspendReq); + /* + * Old versions of XCB encode suspend as 1 byte followed by three + * pad bytes (which are always cleared), instead of a 4 byte + * value. Be compatible by just checking for a non-zero value in + * all 32-bits. + */ + suspend = stuff->suspend != 0; + /* Check if this client is suspending the screensaver */ for (prev = &suspendingClients; (this = *prev); prev = &this->next) if (this->pClient == client) break; if (this) { - if (stuff->suspend == TRUE) + if (suspend == TRUE) this->count++; else if (--this->count == 0) FreeResource(this->clientResource, RT_NONE); @@ -1228,7 +1237,7 @@ ProcScreenSaverSuspend(ClientPtr client) } /* If we get to this point, this client isn't suspending the screensaver */ - if (stuff->suspend == FALSE) + if (suspend == FALSE) return Success; /* @@ -1342,6 +1351,7 @@ SProcScreenSaverSuspend(ClientPtr client) REQUEST(xScreenSaverSuspendReq); swaps(&stuff->length); + swapl(&stuff->suspend); REQUEST_SIZE_MATCH(xScreenSaverSuspendReq); return ProcScreenSaverSuspend(client); }