Xext: saver: consolidate (non-)xinerama versions
We can make it a bit simpler by doing the request header checking only once. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1591>
This commit is contained in:
parent
8236ef3b56
commit
37dd2897d4
31
Xext/saver.c
31
Xext/saver.c
|
@ -703,9 +703,8 @@ ProcScreenSaverSelectInput(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ScreenSaverSetAttributes(ClientPtr client)
|
ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverSetAttributesReq);
|
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
WindowPtr pParent;
|
WindowPtr pParent;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
|
@ -728,7 +727,6 @@ ScreenSaverSetAttributes(ClientPtr client)
|
||||||
Colormap cmap;
|
Colormap cmap;
|
||||||
ColormapPtr pCmap;
|
ColormapPtr pCmap;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
|
||||||
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||||
DixGetAttrAccess);
|
DixGetAttrAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
@ -1045,16 +1043,13 @@ ScreenSaverSetAttributes(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ScreenSaverUnsetAttributes(ClientPtr client)
|
ScreenSaverUnsetAttributes(ClientPtr client, Drawable drawable)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverSetAttributesReq);
|
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
ScreenSaverScreenPrivatePtr pPriv;
|
ScreenSaverScreenPrivatePtr pPriv;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixGetAttrAccess);
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
|
||||||
DixGetAttrAccess);
|
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
pPriv = GetScreenPrivate(pDraw->pScreen);
|
pPriv = GetScreenPrivate(pDraw->pScreen);
|
||||||
|
@ -1070,9 +1065,11 @@ ScreenSaverUnsetAttributes(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverSetAttributes(ClientPtr client)
|
ProcScreenSaverSetAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST(xScreenSaverSetAttributesReq);
|
||||||
|
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (!noPanoramiXExtension) {
|
if (!noPanoramiXExtension) {
|
||||||
REQUEST(xScreenSaverSetAttributesReq);
|
|
||||||
PanoramiXRes *draw;
|
PanoramiXRes *draw;
|
||||||
PanoramiXRes *backPix = NULL;
|
PanoramiXRes *backPix = NULL;
|
||||||
PanoramiXRes *bordPix = NULL;
|
PanoramiXRes *bordPix = NULL;
|
||||||
|
@ -1081,8 +1078,6 @@ ProcScreenSaverSetAttributes(ClientPtr client)
|
||||||
int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
|
int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
|
||||||
XID orig_visual, tmp;
|
XID orig_visual, tmp;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
|
||||||
|
|
||||||
status = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
status = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
||||||
XRC_DRAWABLE, client, DixWriteAccess);
|
XRC_DRAWABLE, client, DixWriteAccess);
|
||||||
if (status != Success)
|
if (status != Success)
|
||||||
|
@ -1144,26 +1139,27 @@ ProcScreenSaverSetAttributes(ClientPtr client)
|
||||||
if (orig_visual != CopyFromParent)
|
if (orig_visual != CopyFromParent)
|
||||||
stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual);
|
stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual);
|
||||||
|
|
||||||
status = ScreenSaverSetAttributes(client);
|
status = ScreenSaverSetAttributes(client, stuff);
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
|
|
||||||
return ScreenSaverSetAttributes(client);
|
return ScreenSaverSetAttributes(client, stuff);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverUnsetAttributes(ClientPtr client)
|
ProcScreenSaverUnsetAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST(xScreenSaverUnsetAttributesReq);
|
||||||
|
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (!noPanoramiXExtension) {
|
if (!noPanoramiXExtension) {
|
||||||
REQUEST(xScreenSaverUnsetAttributesReq);
|
|
||||||
PanoramiXRes *draw;
|
PanoramiXRes *draw;
|
||||||
int rc, i;
|
int rc, i;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
||||||
XRC_DRAWABLE, client, DixWriteAccess);
|
XRC_DRAWABLE, client, DixWriteAccess);
|
||||||
|
@ -1171,15 +1167,14 @@ ProcScreenSaverUnsetAttributes(ClientPtr client)
|
||||||
return (rc == BadValue) ? BadDrawable : rc;
|
return (rc == BadValue) ? BadDrawable : rc;
|
||||||
|
|
||||||
for (i = PanoramiXNumScreens - 1; i > 0; i--) {
|
for (i = PanoramiXNumScreens - 1; i > 0; i--) {
|
||||||
stuff->drawable = draw->info[i].id;
|
ScreenSaverUnsetAttributes(client, draw->info[i].id);
|
||||||
ScreenSaverUnsetAttributes(client);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stuff->drawable = draw->info[0].id;
|
stuff->drawable = draw->info[0].id;
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
|
|
||||||
return ScreenSaverUnsetAttributes(client);
|
return ScreenSaverUnsetAttributes(client, stuff->drawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Reference in New Issue