diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 246a21ccc1..6cadc38494 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -36,6 +36,7 @@ Equipment Corporation. #include "dix/rpcbuf_priv.h" #include "dix/screenint_priv.h" #include "dix/server_priv.h" +#include "dix/window_priv.h" #include "os/osdep.h" #include "Xext/panoramiX.h" #include "Xext/panoramiXsrv.h" @@ -154,7 +155,7 @@ PanoramiXCreateWindow(ClientPtr client) *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[walkScreenIdx].id; if (orig_visual != CopyFromParent) stuff->visual = PanoramiXTranslateVisualID(walkScreenIdx, orig_visual); - result = (*SavedProcVector[X_CreateWindow]) (client); + result = DoCreateWindowReq(client, stuff, (XID*)&stuff[1]); if (result != Success) break; }); diff --git a/dix/dispatch.c b/dix/dispatch.c index 95a5aa350b..b1b06f2219 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -732,23 +732,15 @@ CreateConnectionBlock(void) return TRUE; } -int -ProcCreateWindow(ClientPtr client) +int DoCreateWindowReq(ClientPtr client, xCreateWindowReq *stuff, XID *xids) { WindowPtr pParent, pWin; - - REQUEST(xCreateWindowReq); - int len, rc; - - REQUEST_AT_LEAST_SIZE(xCreateWindowReq); + int rc; LEGAL_NEW_RESOURCE(stuff->wid, client); rc = dixLookupWindow(&pParent, stuff->parent, client, DixAddAccess); if (rc != Success) return rc; - len = client->req_len - bytes_to_int32(sizeof(xCreateWindowReq)); - if (Ones(stuff->mask) != len) - return BadLength; if (!stuff->width || !stuff->height) { client->errorValue = 0; return BadValue; @@ -756,7 +748,7 @@ ProcCreateWindow(ClientPtr client) pWin = dixCreateWindow(stuff->wid, pParent, stuff->x, stuff->y, stuff->width, stuff->height, stuff->borderWidth, stuff->class, - stuff->mask, (XID *) &stuff[1], + stuff->mask, (XID *) xids, (int) stuff->depth, client, stuff->visual, &rc); if (pWin) { Mask mask = pWin->eventMask; @@ -769,6 +761,19 @@ ProcCreateWindow(ClientPtr client) return rc; } +int +ProcCreateWindow(ClientPtr client) +{ + REQUEST(xCreateWindowReq); + REQUEST_AT_LEAST_SIZE(xCreateWindowReq); + + int len = client->req_len - bytes_to_int32(sizeof(xCreateWindowReq)); + if (Ones(stuff->mask) != len) + return BadLength; + + return DoCreateWindowReq(client, stuff, (XID*)&stuff[1]); +} + int ProcChangeWindowAttributes(ClientPtr client) { diff --git a/dix/window_priv.h b/dix/window_priv.h index af6ab917c4..3753e2f247 100644 --- a/dix/window_priv.h +++ b/dix/window_priv.h @@ -53,4 +53,10 @@ Bool MakeWindowOptional(WindowPtr pWin); */ Bool dixWindowIsRoot(Window window); +/* + * @brief lower part of X_CreateWindow request handler. + * Called by ProcCreateWindow() as well as PanoramiXCreateWindow() + */ +int DoCreateWindowReq(ClientPtr client, xCreateWindowReq *stuff, XID *xids); + #endif /* _XSERVER_DIX_WINDOW_PRIV_H */