composite: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
7baf8767a0
commit
adefed6226
|
@ -105,11 +105,7 @@ ProcCompositeQueryVersion(ClientPtr client)
|
||||||
REQUEST_FIELD_CARD32(minorVersion);
|
REQUEST_FIELD_CARD32(minorVersion);
|
||||||
|
|
||||||
CompositeClientPtr pCompositeClient = GetCompositeClient(client);
|
CompositeClientPtr pCompositeClient = GetCompositeClient(client);
|
||||||
xCompositeQueryVersionReply rep = {
|
xCompositeQueryVersionReply rep = { 0 };
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
if (stuff->majorVersion < SERVER_COMPOSITE_MAJOR_VERSION) {
|
if (stuff->majorVersion < SERVER_COMPOSITE_MAJOR_VERSION) {
|
||||||
rep.majorVersion = stuff->majorVersion;
|
rep.majorVersion = stuff->majorVersion;
|
||||||
|
@ -121,14 +117,10 @@ ProcCompositeQueryVersion(ClientPtr client)
|
||||||
}
|
}
|
||||||
pCompositeClient->major_version = rep.majorVersion;
|
pCompositeClient->major_version = rep.majorVersion;
|
||||||
pCompositeClient->minor_version = rep.minorVersion;
|
pCompositeClient->minor_version = rep.minorVersion;
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(majorVersion);
|
||||||
swapl(&rep.length);
|
REPLY_FIELD_CARD32(minorVersion);
|
||||||
swapl(&rep.majorVersion);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.minorVersion);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xCompositeQueryVersionReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VERIFY_WINDOW(pWindow, wid, client, mode) \
|
#define VERIFY_WINDOW(pWindow, wid, client, mode) \
|
||||||
|
@ -267,7 +259,6 @@ SingleCompositeNameWindowPixmap(ClientPtr client, xCompositeNameWindowPixmapReq
|
||||||
static int
|
static int
|
||||||
SingleCompositeGetOverlayWindow(ClientPtr client, xCompositeGetOverlayWindowReq *stuff)
|
SingleCompositeGetOverlayWindow(ClientPtr client, xCompositeGetOverlayWindowReq *stuff)
|
||||||
{
|
{
|
||||||
xCompositeGetOverlayWindowReply rep;
|
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
CompScreenPtr cs;
|
CompScreenPtr cs;
|
||||||
|
@ -303,21 +294,12 @@ SingleCompositeGetOverlayWindow(ClientPtr client, xCompositeGetOverlayWindowReq
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = (xCompositeGetOverlayWindowReply) {
|
xCompositeGetOverlayWindowReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.overlayWin = cs->pOverlayWin->drawable.id
|
.overlayWin = cs->pOverlayWin->drawable.id
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(overlayWin);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.length);
|
|
||||||
swapl(&rep.overlayWin);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep);
|
|
||||||
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -682,7 +664,6 @@ ProcCompositeGetOverlayWindow(ClientPtr client)
|
||||||
if (!compositeUseXinerama)
|
if (!compositeUseXinerama)
|
||||||
return SingleCompositeGetOverlayWindow(client, stuff);
|
return SingleCompositeGetOverlayWindow(client, stuff);
|
||||||
|
|
||||||
xCompositeGetOverlayWindowReply rep;
|
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
CompScreenPtr cs;
|
CompScreenPtr cs;
|
||||||
|
@ -760,20 +741,12 @@ ProcCompositeGetOverlayWindow(ClientPtr client)
|
||||||
|
|
||||||
cs = GetCompScreen(screenInfo.screens[0]);
|
cs = GetCompScreen(screenInfo.screens[0]);
|
||||||
|
|
||||||
rep = (xCompositeGetOverlayWindowReply) {
|
xCompositeGetOverlayWindowReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.overlayWin = cs->pOverlayWin->drawable.id
|
.overlayWin = cs->pOverlayWin->drawable.id
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(overlayWin);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.length);
|
|
||||||
swapl(&rep.overlayWin);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep);
|
|
||||||
return Success;
|
|
||||||
#else
|
#else
|
||||||
return SingleCompositeGetOverlayWindow(client, stuff);
|
return SingleCompositeGetOverlayWindow(client, stuff);
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
|
|
Loading…
Reference in New Issue