diff --git a/Xext/saver.c b/Xext/saver.c index d08095f3d..be3e0a754 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -700,9 +700,8 @@ ProcScreenSaverSelectInput(ClientPtr client) } static int -ScreenSaverSetAttributes(ClientPtr client) +ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff) { - REQUEST(xScreenSaverSetAttributesReq); DrawablePtr pDraw; WindowPtr pParent; ScreenPtr pScreen; @@ -725,7 +724,6 @@ ScreenSaverSetAttributes(ClientPtr client) Colormap cmap; ColormapPtr pCmap; - REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq); ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixGetAttrAccess); if (ret != Success) @@ -1042,16 +1040,13 @@ ScreenSaverSetAttributes(ClientPtr client) } static int -ScreenSaverUnsetAttributes(ClientPtr client) +ScreenSaverUnsetAttributes(ClientPtr client, Drawable drawable) { - REQUEST(xScreenSaverSetAttributesReq); DrawablePtr pDraw; ScreenSaverScreenPrivatePtr pPriv; int rc; - REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq); - rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, - DixGetAttrAccess); + rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixGetAttrAccess); if (rc != Success) return rc; pPriv = GetScreenPrivate(pDraw->pScreen); @@ -1067,9 +1062,11 @@ ScreenSaverUnsetAttributes(ClientPtr client) static int ProcScreenSaverSetAttributes(ClientPtr client) { + REQUEST(xScreenSaverSetAttributesReq); + REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq); + #ifdef PANORAMIX if (!noPanoramiXExtension) { - REQUEST(xScreenSaverSetAttributesReq); PanoramiXRes *draw; PanoramiXRes *backPix = NULL; PanoramiXRes *bordPix = NULL; @@ -1078,8 +1075,6 @@ ProcScreenSaverSetAttributes(ClientPtr client) int pback_offset = 0, pbord_offset = 0, cmap_offset = 0; XID orig_visual, tmp; - REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq); - status = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); if (status != Success) @@ -1141,26 +1136,27 @@ ProcScreenSaverSetAttributes(ClientPtr client) if (orig_visual != CopyFromParent) stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual); - status = ScreenSaverSetAttributes(client); + status = ScreenSaverSetAttributes(client, stuff); } return status; } #endif - return ScreenSaverSetAttributes(client); + return ScreenSaverSetAttributes(client, stuff); } static int ProcScreenSaverUnsetAttributes(ClientPtr client) { + REQUEST(xScreenSaverUnsetAttributesReq); + REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq); + #ifdef PANORAMIX if (!noPanoramiXExtension) { - REQUEST(xScreenSaverUnsetAttributesReq); PanoramiXRes *draw; int rc, i; - REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq); rc = dixLookupResourceByClass((void **) &draw, stuff->drawable, XRC_DRAWABLE, client, DixWriteAccess); @@ -1168,15 +1164,14 @@ ProcScreenSaverUnsetAttributes(ClientPtr client) return (rc == BadValue) ? BadDrawable : rc; for (i = PanoramiXNumScreens - 1; i > 0; i--) { - stuff->drawable = draw->info[i].id; - ScreenSaverUnsetAttributes(client); + ScreenSaverUnsetAttributes(client, draw->info[i].id); } stuff->drawable = draw->info[0].id; } #endif - return ScreenSaverUnsetAttributes(client); + return ScreenSaverUnsetAttributes(client, stuff->drawable); } static int