Merge remote branch 'jamey/for-keith'

This commit is contained in:
Keith Packard 2010-05-19 12:58:02 -07:00
commit 8b6c1809c0
59 changed files with 397 additions and 544 deletions

View File

@ -519,6 +519,10 @@ void PanoramiXExtensionInit(int argc, char *argv[])
panoramiXGeneration = serverGeneration; panoramiXGeneration = serverGeneration;
success = TRUE; success = TRUE;
} }
SetResourceTypeErrorValue(XRT_WINDOW, BadWindow);
SetResourceTypeErrorValue(XRT_PIXMAP, BadPixmap);
SetResourceTypeErrorValue(XRT_GC, BadGC);
SetResourceTypeErrorValue(XRT_COLORMAP, BadColor);
} }
if (!success) { if (!success) {

View File

@ -74,7 +74,7 @@ int PanoramiXCreateWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&parent, stuff->parent, result = dixLookupResourceByType((pointer *)&parent, stuff->parent,
XRT_WINDOW, client, DixWriteAccess); XRT_WINDOW, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
if(stuff->class == CopyFromParent) if(stuff->class == CopyFromParent)
stuff->class = parent->u.win.class; stuff->class = parent->u.win.class;
@ -89,7 +89,7 @@ int PanoramiXCreateWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&backPix, tmp, result = dixLookupResourceByType((pointer *)&backPix, tmp,
XRT_PIXMAP, client, DixReadAccess); XRT_PIXMAP, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadPixmap : result; return result;
} }
} }
if ((Mask)stuff->mask & CWBorderPixmap) { if ((Mask)stuff->mask & CWBorderPixmap) {
@ -99,7 +99,7 @@ int PanoramiXCreateWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&bordPix, tmp, result = dixLookupResourceByType((pointer *)&bordPix, tmp,
XRT_PIXMAP, client, DixReadAccess); XRT_PIXMAP, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadPixmap : result; return result;
} }
} }
if ((Mask)stuff->mask & CWColormap) { if ((Mask)stuff->mask & CWColormap) {
@ -109,7 +109,7 @@ int PanoramiXCreateWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, tmp, result = dixLookupResourceByType((pointer *)&cmap, tmp,
XRT_COLORMAP, client, DixReadAccess); XRT_COLORMAP, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
} }
} }
@ -179,7 +179,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window, result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixWriteAccess); XRT_WINDOW, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
if((win->u.win.class == InputOnly) && if((win->u.win.class == InputOnly) &&
(stuff->valueMask & (~INPUTONLY_LEGAL_MASK))) (stuff->valueMask & (~INPUTONLY_LEGAL_MASK)))
@ -192,7 +192,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
result = dixLookupResourceByType((pointer *)&backPix, tmp, result = dixLookupResourceByType((pointer *)&backPix, tmp,
XRT_PIXMAP, client, DixReadAccess); XRT_PIXMAP, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadPixmap : result; return result;
} }
} }
if ((Mask)stuff->valueMask & CWBorderPixmap) { if ((Mask)stuff->valueMask & CWBorderPixmap) {
@ -202,7 +202,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
result = dixLookupResourceByType((pointer *)&bordPix, tmp, result = dixLookupResourceByType((pointer *)&bordPix, tmp,
XRT_PIXMAP, client, DixReadAccess); XRT_PIXMAP, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadPixmap : result; return result;
} }
} }
if ((Mask)stuff->valueMask & CWColormap) { if ((Mask)stuff->valueMask & CWColormap) {
@ -212,7 +212,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, tmp, result = dixLookupResourceByType((pointer *)&cmap, tmp,
XRT_COLORMAP, client, DixReadAccess); XRT_COLORMAP, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
} }
} }
@ -242,7 +242,7 @@ int PanoramiXDestroyWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->id, XRT_WINDOW, result = dixLookupResourceByType((pointer *)&win, stuff->id, XRT_WINDOW,
client, DixDestroyAccess); client, DixDestroyAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
stuff->id = win->info[j].id; stuff->id = win->info[j].id;
@ -268,7 +268,7 @@ int PanoramiXDestroySubwindows(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->id, XRT_WINDOW, result = dixLookupResourceByType((pointer *)&win, stuff->id, XRT_WINDOW,
client, DixDestroyAccess); client, DixDestroyAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
stuff->id = win->info[j].id; stuff->id = win->info[j].id;
@ -294,7 +294,7 @@ int PanoramiXChangeSaveSet(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window, result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixReadAccess); XRT_WINDOW, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
stuff->window = win->info[j].id; stuff->window = win->info[j].id;
@ -319,12 +319,12 @@ int PanoramiXReparentWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window, result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixWriteAccess); XRT_WINDOW, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
result = dixLookupResourceByType((pointer *)&parent, stuff->parent, result = dixLookupResourceByType((pointer *)&parent, stuff->parent,
XRT_WINDOW, client, DixWriteAccess); XRT_WINDOW, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
x = stuff->x; x = stuff->x;
y = stuff->y; y = stuff->y;
@ -356,7 +356,7 @@ int PanoramiXMapWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->id, result = dixLookupResourceByType((pointer *)&win, stuff->id,
XRT_WINDOW, client, DixReadAccess); XRT_WINDOW, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
FOR_NSCREENS_FORWARD(j) { FOR_NSCREENS_FORWARD(j) {
stuff->id = win->info[j].id; stuff->id = win->info[j].id;
@ -379,7 +379,7 @@ int PanoramiXMapSubwindows(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->id, result = dixLookupResourceByType((pointer *)&win, stuff->id,
XRT_WINDOW, client, DixReadAccess); XRT_WINDOW, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
FOR_NSCREENS_FORWARD(j) { FOR_NSCREENS_FORWARD(j) {
stuff->id = win->info[j].id; stuff->id = win->info[j].id;
@ -402,7 +402,7 @@ int PanoramiXUnmapWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->id, result = dixLookupResourceByType((pointer *)&win, stuff->id,
XRT_WINDOW, client, DixReadAccess); XRT_WINDOW, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
FOR_NSCREENS_FORWARD(j) { FOR_NSCREENS_FORWARD(j) {
stuff->id = win->info[j].id; stuff->id = win->info[j].id;
@ -425,7 +425,7 @@ int PanoramiXUnmapSubwindows(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->id, result = dixLookupResourceByType((pointer *)&win, stuff->id,
XRT_WINDOW, client, DixReadAccess); XRT_WINDOW, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
FOR_NSCREENS_FORWARD(j) { FOR_NSCREENS_FORWARD(j) {
stuff->id = win->info[j].id; stuff->id = win->info[j].id;
@ -457,12 +457,12 @@ int PanoramiXConfigureWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&pWin, stuff->window, result = dixLookupResourceByType((pointer *)&pWin, stuff->window,
RT_WINDOW, client, DixWriteAccess); RT_WINDOW, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
result = dixLookupResourceByType((pointer *)&win, stuff->window, result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixWriteAccess); XRT_WINDOW, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
if ((Mask)stuff->mask & CWSibling) { if ((Mask)stuff->mask & CWSibling) {
XID tmp; XID tmp;
@ -471,7 +471,7 @@ int PanoramiXConfigureWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&sib, tmp, XRT_WINDOW, result = dixLookupResourceByType((pointer *)&sib, tmp, XRT_WINDOW,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
} }
} }
@ -517,7 +517,7 @@ int PanoramiXCirculateWindow(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window, result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixWriteAccess); XRT_WINDOW, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
FOR_NSCREENS_FORWARD(j) { FOR_NSCREENS_FORWARD(j) {
stuff->window = win->info[j].id; stuff->window = win->info[j].id;
@ -697,7 +697,7 @@ int PanoramiXFreePixmap(ClientPtr client)
result = dixLookupResourceByType((pointer *)&pix, stuff->id, XRT_PIXMAP, result = dixLookupResourceByType((pointer *)&pix, stuff->id, XRT_PIXMAP,
client, DixDestroyAccess); client, DixDestroyAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadPixmap : result; return result;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
stuff->id = pix->info[j].id; stuff->id = pix->info[j].id;
@ -742,7 +742,7 @@ int PanoramiXCreateGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&tile, tmp, XRT_PIXMAP, result = dixLookupResourceByType((pointer *)&tile, tmp, XRT_PIXMAP,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadPixmap : result; return result;
} }
} }
if ((Mask)stuff->mask & GCStipple) { if ((Mask)stuff->mask & GCStipple) {
@ -751,7 +751,7 @@ int PanoramiXCreateGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&stip, tmp, XRT_PIXMAP, result = dixLookupResourceByType((pointer *)&stip, tmp, XRT_PIXMAP,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadPixmap : result; return result;
} }
} }
if ((Mask)stuff->mask & GCClipMask) { if ((Mask)stuff->mask & GCClipMask) {
@ -760,7 +760,7 @@ int PanoramiXCreateGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&clip, tmp, XRT_PIXMAP, result = dixLookupResourceByType((pointer *)&clip, tmp, XRT_PIXMAP,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadPixmap : result; return result;
} }
} }
@ -813,7 +813,7 @@ int PanoramiXChangeGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
if ((Mask)stuff->mask & GCTile) { if ((Mask)stuff->mask & GCTile) {
tile_offset = Ones((Mask)stuff->mask & (GCTile - 1)); tile_offset = Ones((Mask)stuff->mask & (GCTile - 1));
@ -821,7 +821,7 @@ int PanoramiXChangeGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&tile, tmp, XRT_PIXMAP, result = dixLookupResourceByType((pointer *)&tile, tmp, XRT_PIXMAP,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadPixmap : result; return result;
} }
} }
if ((Mask)stuff->mask & GCStipple) { if ((Mask)stuff->mask & GCStipple) {
@ -830,7 +830,7 @@ int PanoramiXChangeGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&stip, tmp, XRT_PIXMAP, result = dixLookupResourceByType((pointer *)&stip, tmp, XRT_PIXMAP,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadPixmap : result; return result;
} }
} }
if ((Mask)stuff->mask & GCClipMask) { if ((Mask)stuff->mask & GCClipMask) {
@ -839,7 +839,7 @@ int PanoramiXChangeGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&clip, tmp, XRT_PIXMAP, result = dixLookupResourceByType((pointer *)&clip, tmp, XRT_PIXMAP,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadPixmap : result; return result;
} }
} }
@ -871,12 +871,12 @@ int PanoramiXCopyGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&srcGC, stuff->srcGC, XRT_GC, result = dixLookupResourceByType((pointer *)&srcGC, stuff->srcGC, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
result = dixLookupResourceByType((pointer *)&dstGC, stuff->dstGC, XRT_GC, result = dixLookupResourceByType((pointer *)&dstGC, stuff->dstGC, XRT_GC,
client, DixWriteAccess); client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
FOR_NSCREENS(j) { FOR_NSCREENS(j) {
stuff->srcGC = srcGC->info[j].id; stuff->srcGC = srcGC->info[j].id;
@ -900,7 +900,7 @@ int PanoramiXSetDashes(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixWriteAccess); client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
stuff->gc = gc->info[j].id; stuff->gc = gc->info[j].id;
@ -923,7 +923,7 @@ int PanoramiXSetClipRectangles(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixWriteAccess); client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
stuff->gc = gc->info[j].id; stuff->gc = gc->info[j].id;
@ -946,7 +946,7 @@ int PanoramiXFreeGC(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->id, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->id, XRT_GC,
client, DixDestroyAccess); client, DixDestroyAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
stuff->id = gc->info[j].id; stuff->id = gc->info[j].id;
@ -973,7 +973,7 @@ int PanoramiXClearToBackground(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window, result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixWriteAccess); XRT_WINDOW, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
x = stuff->x; x = stuff->x;
y = stuff->y; y = stuff->y;
@ -1033,7 +1033,7 @@ int PanoramiXCopyArea(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
if((dst->type == XRT_WINDOW) && dst->u.win.root) if((dst->type == XRT_WINDOW) && dst->u.win.root)
dstIsRoot = TRUE; dstIsRoot = TRUE;
@ -1188,7 +1188,7 @@ int PanoramiXCopyPlane(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, rc = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? BadGC : rc; return rc;
if((dst->type == XRT_WINDOW) && dst->u.win.root) if((dst->type == XRT_WINDOW) && dst->u.win.root)
dstIsRoot = TRUE; dstIsRoot = TRUE;
@ -1285,7 +1285,7 @@ int PanoramiXPolyPoint(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq)); npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq));
@ -1345,7 +1345,7 @@ int PanoramiXPolyLine(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq)); npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
@ -1405,7 +1405,7 @@ int PanoramiXPolySegment(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1468,7 +1468,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1530,7 +1530,7 @@ int PanoramiXPolyArc(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1590,7 +1590,7 @@ int PanoramiXFillPoly(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1651,7 +1651,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1712,7 +1712,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1772,7 +1772,7 @@ int PanoramiXPutImage(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1973,7 +1973,7 @@ PanoramiXPolyText8(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -2014,7 +2014,7 @@ PanoramiXPolyText16(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -2055,7 +2055,7 @@ int PanoramiXImageText8(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -2096,7 +2096,7 @@ int PanoramiXImageText16(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC, result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -2128,7 +2128,7 @@ int PanoramiXCreateColormap(ClientPtr client)
result = dixLookupResourceByType((pointer *)&win, stuff->window, result = dixLookupResourceByType((pointer *)&win, stuff->window,
XRT_WINDOW, client, DixReadAccess); XRT_WINDOW, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
if(!(newCmap = malloc(sizeof(PanoramiXRes)))) if(!(newCmap = malloc(sizeof(PanoramiXRes))))
return BadAlloc; return BadAlloc;
@ -2169,7 +2169,7 @@ int PanoramiXFreeColormap(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->id, XRT_COLORMAP, result = dixLookupResourceByType((pointer *)&cmap, stuff->id, XRT_COLORMAP,
client, DixDestroyAccess); client, DixDestroyAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
stuff->id = cmap->info[j].id; stuff->id = cmap->info[j].id;
@ -2199,7 +2199,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
XRT_COLORMAP, client, XRT_COLORMAP, client,
DixReadAccess | DixWriteAccess); DixReadAccess | DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
if(!(newCmap = malloc(sizeof(PanoramiXRes)))) if(!(newCmap = malloc(sizeof(PanoramiXRes))))
return BadAlloc; return BadAlloc;
@ -2238,7 +2238,7 @@ int PanoramiXInstallColormap(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->id, XRT_COLORMAP, result = dixLookupResourceByType((pointer *)&cmap, stuff->id, XRT_COLORMAP,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
stuff->id = cmap->info[j].id; stuff->id = cmap->info[j].id;
@ -2262,7 +2262,7 @@ int PanoramiXUninstallColormap(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->id, XRT_COLORMAP, result = dixLookupResourceByType((pointer *)&cmap, stuff->id, XRT_COLORMAP,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
stuff->id = cmap->info[j].id; stuff->id = cmap->info[j].id;
@ -2286,7 +2286,7 @@ int PanoramiXAllocColor(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess); XRT_COLORMAP, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
stuff->cmap = cmap->info[j].id; stuff->cmap = cmap->info[j].id;
@ -2310,7 +2310,7 @@ int PanoramiXAllocNamedColor(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess); XRT_COLORMAP, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
stuff->cmap = cmap->info[j].id; stuff->cmap = cmap->info[j].id;
@ -2334,7 +2334,7 @@ int PanoramiXAllocColorCells(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess); XRT_COLORMAP, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
stuff->cmap = cmap->info[j].id; stuff->cmap = cmap->info[j].id;
@ -2358,7 +2358,7 @@ int PanoramiXAllocColorPlanes(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess); XRT_COLORMAP, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
stuff->cmap = cmap->info[j].id; stuff->cmap = cmap->info[j].id;
@ -2383,7 +2383,7 @@ int PanoramiXFreeColors(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess); XRT_COLORMAP, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
FOR_NSCREENS_BACKWARD(j) { FOR_NSCREENS_BACKWARD(j) {
stuff->cmap = cmap->info[j].id; stuff->cmap = cmap->info[j].id;
@ -2406,7 +2406,7 @@ int PanoramiXStoreColors(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess); XRT_COLORMAP, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
stuff->cmap = cmap->info[j].id; stuff->cmap = cmap->info[j].id;
@ -2430,7 +2430,7 @@ int PanoramiXStoreNamedColor(ClientPtr client)
result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
XRT_COLORMAP, client, DixWriteAccess); XRT_COLORMAP, client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadColor : result; return result;
FOR_NSCREENS_BACKWARD(j){ FOR_NSCREENS_BACKWARD(j){
stuff->cmap = cmap->info[j].id; stuff->cmap = cmap->info[j].id;

View File

@ -480,7 +480,6 @@ SendScreenSaverNotify (ScreenPtr pScreen, int state, Bool forced)
ScreenSaverEventPtr pEv; ScreenSaverEventPtr pEv;
unsigned long mask; unsigned long mask;
xScreenSaverNotifyEvent ev; xScreenSaverNotifyEvent ev;
ClientPtr client;
int kind; int kind;
UpdateCurrentTimeIf (); UpdateCurrentTimeIf ();
@ -499,20 +498,16 @@ SendScreenSaverNotify (ScreenPtr pScreen, int state, Bool forced)
kind = ScreenSaverInternal; kind = ScreenSaverInternal;
for (pEv = pPriv->events; pEv; pEv = pEv->next) for (pEv = pPriv->events; pEv; pEv = pEv->next)
{ {
client = pEv->client;
if (client->clientGone)
continue;
if (!(pEv->mask & mask)) if (!(pEv->mask & mask))
continue; continue;
ev.type = ScreenSaverNotify + ScreenSaverEventBase; ev.type = ScreenSaverNotify + ScreenSaverEventBase;
ev.state = state; ev.state = state;
ev.sequenceNumber = client->sequence;
ev.timestamp = currentTime.milliseconds; ev.timestamp = currentTime.milliseconds;
ev.root = WindowTable[pScreen->myNum]->drawable.id; ev.root = WindowTable[pScreen->myNum]->drawable.id;
ev.window = savedScreenInfo[pScreen->myNum].wid; ev.window = savedScreenInfo[pScreen->myNum].wid;
ev.kind = kind; ev.kind = kind;
ev.forced = forced; ev.forced = forced;
WriteEventsToClient (client, 1, (xEvent *) &ev); WriteEventsToClient (pEv->client, 1, (xEvent *) &ev);
} }
} }
@ -1048,7 +1043,6 @@ ScreenSaverSetAttributes (ClientPtr client)
} }
else else
{ {
ret = (ret == BadValue) ? BadPixmap : ret;
client->errorValue = pixID; client->errorValue = pixID;
goto PatchUp; goto PatchUp;
} }
@ -1086,7 +1080,6 @@ ScreenSaverSetAttributes (ClientPtr client)
} }
else else
{ {
ret = (ret == BadValue) ? BadPixmap : ret;
client->errorValue = pixID; client->errorValue = pixID;
goto PatchUp; goto PatchUp;
} }
@ -1168,7 +1161,6 @@ ScreenSaverSetAttributes (ClientPtr client)
client, DixUseAccess); client, DixUseAccess);
if (ret != Success) if (ret != Success)
{ {
ret = (ret == BadValue) ? BadColor : ret;
client->errorValue = cmap; client->errorValue = cmap;
goto PatchUp; goto PatchUp;
} }
@ -1192,7 +1184,6 @@ ScreenSaverSetAttributes (ClientPtr client)
RT_CURSOR, client, DixUseAccess); RT_CURSOR, client, DixUseAccess);
if (ret != Success) if (ret != Success)
{ {
ret = (ret == BadValue) ? BadCursor : ret;
client->errorValue = cursorID; client->errorValue = cursorID;
goto PatchUp; goto PatchUp;
} }
@ -1281,7 +1272,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
XRT_PIXMAP, client, XRT_PIXMAP, client,
DixReadAccess); DixReadAccess);
if (status != Success) if (status != Success)
return (status == BadValue) ? BadPixmap : status; return status;
} }
} }
@ -1293,7 +1284,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
XRT_PIXMAP, client, XRT_PIXMAP, client,
DixReadAccess); DixReadAccess);
if (status != Success) if (status != Success)
return (status == BadValue) ? BadPixmap : status; return status;
} }
} }
@ -1305,7 +1296,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
XRT_COLORMAP, client, XRT_COLORMAP, client,
DixReadAccess); DixReadAccess);
if (status != Success) if (status != Success)
return (status == BadValue) ? BadColor : status; return status;
} }
} }

View File

@ -198,16 +198,10 @@ SecurityDeleteAuthorization(
while ((pEventClient = pAuth->eventClients)) while ((pEventClient = pAuth->eventClients))
{ {
/* send revocation event event */ /* send revocation event event */
ClientPtr client = rClient(pEventClient); xSecurityAuthorizationRevokedEvent are;
are.type = SecurityEventBase + XSecurityAuthorizationRevoked;
if (!client->clientGone) are.authId = pAuth->id;
{ WriteEventsToClient(rClient(pEventClient), 1, (xEvent *)&are);
xSecurityAuthorizationRevokedEvent are;
are.type = SecurityEventBase + XSecurityAuthorizationRevoked;
are.sequenceNumber = client->sequence;
are.authId = pAuth->id;
WriteEventsToClient(client, 1, (xEvent *)&are);
}
FreeResource(pEventClient->resource, RT_NONE); FreeResource(pEventClient->resource, RT_NONE);
} }
@ -629,8 +623,7 @@ ProcSecurityRevokeAuthorization(
SecurityAuthorizationResType, client, SecurityAuthorizationResType, client,
DixDestroyAccess); DixDestroyAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? return rc;
SecurityErrorBase + XSecurityBadAuthorization : rc;
FreeResource(stuff->authId, RT_NONE); FreeResource(stuff->authId, RT_NONE);
return Success; return Success;
@ -1146,6 +1139,8 @@ SecurityExtensionInit(INITARGS)
EventSwapVector[SecurityEventBase + XSecurityAuthorizationRevoked] = EventSwapVector[SecurityEventBase + XSecurityAuthorizationRevoked] =
(EventSwapPtr)SwapSecurityAuthorizationRevokedEvent; (EventSwapPtr)SwapSecurityAuthorizationRevokedEvent;
SetResourceTypeErrorValue(SecurityAuthorizationResType, SecurityErrorBase + XSecurityBadAuthorization);
/* Label objects that were created before we could register ourself */ /* Label objects that were created before we could register ourself */
SecurityLabelInitial(); SecurityLabelInitial();
} }

View File

@ -360,7 +360,7 @@ ProcPanoramiXShapeRectangles(
result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW, result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
client, DixWriteAccess); client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
FOR_NSCREENS(j) { FOR_NSCREENS(j) {
stuff->dest = win->info[j].id; stuff->dest = win->info[j].id;
@ -415,7 +415,7 @@ ProcShapeMask (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pPixmap, stuff->src, RT_PIXMAP, rc = dixLookupResourceByType((pointer *)&pPixmap, stuff->src, RT_PIXMAP,
client, DixReadAccess); client, DixReadAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? BadPixmap : rc; return rc;
if (pPixmap->drawable.pScreen != pScreen || if (pPixmap->drawable.pScreen != pScreen ||
pPixmap->drawable.depth != 1) pPixmap->drawable.depth != 1)
return BadMatch; return BadMatch;
@ -459,13 +459,13 @@ ProcPanoramiXShapeMask(
result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW, result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
client, DixWriteAccess); client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
if(stuff->src != None) { if(stuff->src != None) {
result = dixLookupResourceByType((pointer *)&pmap, stuff->src, result = dixLookupResourceByType((pointer *)&pmap, stuff->src,
XRT_PIXMAP, client, DixReadAccess); XRT_PIXMAP, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadPixmap : result; return result;
} else } else
pmap = NULL; pmap = NULL;
@ -589,12 +589,12 @@ ProcPanoramiXShapeCombine(
result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW, result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
client, DixWriteAccess); client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
result = dixLookupResourceByType((pointer *)&win2, stuff->src, XRT_WINDOW, result = dixLookupResourceByType((pointer *)&win2, stuff->src, XRT_WINDOW,
client, DixReadAccess); client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
FOR_NSCREENS(j) { FOR_NSCREENS(j) {
stuff->dest = win->info[j].id; stuff->dest = win->info[j].id;
@ -663,7 +663,7 @@ ProcPanoramiXShapeOffset(
result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW, result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
client, DixWriteAccess); client, DixWriteAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadWindow : result; return result;
FOR_NSCREENS(j) { FOR_NSCREENS(j) {
stuff->dest = win->info[j].id; stuff->dest = win->info[j].id;
@ -885,7 +885,6 @@ void
SendShapeNotify (WindowPtr pWin, int which) SendShapeNotify (WindowPtr pWin, int which)
{ {
ShapeEventPtr *pHead, pShapeEvent; ShapeEventPtr *pHead, pShapeEvent;
ClientPtr client;
xShapeNotifyEvent se; xShapeNotifyEvent se;
BoxRec extents; BoxRec extents;
RegionPtr region; RegionPtr region;
@ -940,20 +939,16 @@ SendShapeNotify (WindowPtr pWin, int which)
return; return;
} }
for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) { for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
client = pShapeEvent->client;
if (client == serverClient || client->clientGone)
continue;
se.type = ShapeNotify + ShapeEventBase; se.type = ShapeNotify + ShapeEventBase;
se.kind = which; se.kind = which;
se.window = pWin->drawable.id; se.window = pWin->drawable.id;
se.sequenceNumber = client->sequence;
se.x = extents.x1; se.x = extents.x1;
se.y = extents.y1; se.y = extents.y1;
se.width = extents.x2 - extents.x1; se.width = extents.x2 - extents.x1;
se.height = extents.y2 - extents.y1; se.height = extents.y2 - extents.y1;
se.time = currentTime.milliseconds; se.time = currentTime.milliseconds;
se.shaped = shaped; se.shaped = shaped;
WriteEventsToClient (client, 1, (xEvent *) &se); WriteEventsToClient (pShapeEvent->client, 1, (xEvent *) &se);
} }
} }

View File

@ -156,7 +156,7 @@ static ShmFuncs fbFuncs = {fbShmCreatePixmap, NULL};
rc = dixLookupResourceByType((pointer *)&(shmdesc), shmseg, ShmSegType, \ rc = dixLookupResourceByType((pointer *)&(shmdesc), shmseg, ShmSegType, \
client, DixReadAccess); \ client, DixReadAccess); \
if (rc != Success) \ if (rc != Success) \
return (rc == BadValue) ? BadShmSegCode : rc; \ return rc; \
} }
#define VERIFY_SHMPTR(shmseg,offset,needwrite,shmdesc,client) \ #define VERIFY_SHMPTR(shmseg,offset,needwrite,shmdesc,client) \
@ -286,6 +286,7 @@ ShmExtensionInit(INITARGS)
ShmReqCode = (unsigned char)extEntry->base; ShmReqCode = (unsigned char)extEntry->base;
ShmCompletionCode = extEntry->eventBase; ShmCompletionCode = extEntry->eventBase;
BadShmSegCode = extEntry->errorBase; BadShmSegCode = extEntry->errorBase;
SetResourceTypeErrorValue(ShmSegType, BadShmSegCode);
EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent; EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent;
} }
} }
@ -584,7 +585,7 @@ ProcPanoramiXShmPutImage(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, result = dixLookupResourceByType((pointer *)&gc, stuff->gc,
XRT_GC, client, DixReadAccess); XRT_GC, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -943,7 +944,6 @@ ProcShmPutImage(ClientPtr client)
ev.type = ShmCompletionCode; ev.type = ShmCompletionCode;
ev.drawable = stuff->drawable; ev.drawable = stuff->drawable;
ev.sequenceNumber = client->sequence;
ev.minorEvent = X_ShmPutImage; ev.minorEvent = X_ShmPutImage;
ev.majorEvent = ShmReqCode; ev.majorEvent = ShmReqCode;
ev.shmseg = stuff->shmseg; ev.shmseg = stuff->shmseg;

View File

@ -264,7 +264,7 @@ SyncInitTrigger(ClientPtr client, SyncTrigger *pTrigger, XSyncCounter counter,
counter, RTCounter, client, DixReadAccess))) counter, RTCounter, client, DixReadAccess)))
{ {
client->errorValue = counter; client->errorValue = counter;
return (rc == BadValue) ? SyncErrorBase + XSyncBadCounter : rc; return rc;
} }
if (pCounter != pTrigger->pCounter) if (pCounter != pTrigger->pCounter)
{ /* new counter for trigger */ { /* new counter for trigger */
@ -372,7 +372,6 @@ SyncSendAlarmNotifyEvents(SyncAlarm *pAlarm)
ane.type = SyncEventBase + XSyncAlarmNotify; ane.type = SyncEventBase + XSyncAlarmNotify;
ane.kind = XSyncAlarmNotify; ane.kind = XSyncAlarmNotify;
ane.sequenceNumber = pAlarm->client->sequence;
ane.alarm = pAlarm->alarm_id; ane.alarm = pAlarm->alarm_id;
if (pTrigger->pCounter) if (pTrigger->pCounter)
{ {
@ -390,18 +389,12 @@ SyncSendAlarmNotifyEvents(SyncAlarm *pAlarm)
ane.state = pAlarm->state; ane.state = pAlarm->state;
/* send to owner */ /* send to owner */
if (pAlarm->events && !pAlarm->client->clientGone) if (pAlarm->events)
WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane); WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane);
/* send to other interested clients */ /* send to other interested clients */
for (pcl = pAlarm->pEventClients; pcl; pcl = pcl->next) for (pcl = pAlarm->pEventClients; pcl; pcl = pcl->next)
{ WriteEventsToClient(pcl->client, 1, (xEvent *) &ane);
if (!pcl->client->clientGone)
{
ane.sequenceNumber = pcl->client->sequence;
WriteEventsToClient(pcl->client, 1, (xEvent *) &ane);
}
}
} }
@ -426,7 +419,6 @@ SyncSendCounterNotifyEvents(ClientPtr client, SyncAwait **ppAwait,
SyncTrigger *pTrigger = &(*ppAwait)->trigger; SyncTrigger *pTrigger = &(*ppAwait)->trigger;
pev->type = SyncEventBase + XSyncCounterNotify; pev->type = SyncEventBase + XSyncCounterNotify;
pev->kind = XSyncCounterNotify; pev->kind = XSyncCounterNotify;
pev->sequenceNumber = client->sequence;
pev->counter = pTrigger->pCounter->id; pev->counter = pTrigger->pCounter->id;
pev->wait_value_lo = XSyncValueLow32(pTrigger->test_value); pev->wait_value_lo = XSyncValueLow32(pTrigger->test_value);
pev->wait_value_hi = XSyncValueHigh32(pTrigger->test_value); pev->wait_value_hi = XSyncValueHigh32(pTrigger->test_value);
@ -1336,7 +1328,7 @@ ProcSyncSetCounter(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pCounter, stuff->cid, RTCounter, rc = dixLookupResourceByType((pointer *)&pCounter, stuff->cid, RTCounter,
client, DixWriteAccess); client, DixWriteAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? SyncErrorBase + XSyncBadCounter : rc; return rc;
if (IsSystemCounter(pCounter)) if (IsSystemCounter(pCounter))
{ {
@ -1366,7 +1358,7 @@ ProcSyncChangeCounter(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pCounter, stuff->cid, RTCounter, rc = dixLookupResourceByType((pointer *)&pCounter, stuff->cid, RTCounter,
client, DixWriteAccess); client, DixWriteAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? SyncErrorBase + XSyncBadCounter : rc; return rc;
if (IsSystemCounter(pCounter)) if (IsSystemCounter(pCounter))
{ {
@ -1401,7 +1393,7 @@ ProcSyncDestroyCounter(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pCounter, stuff->counter, RTCounter, rc = dixLookupResourceByType((pointer *)&pCounter, stuff->counter, RTCounter,
client, DixDestroyAccess); client, DixDestroyAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? SyncErrorBase + XSyncBadCounter : rc; return rc;
if (IsSystemCounter(pCounter)) if (IsSystemCounter(pCounter))
{ {
@ -1544,7 +1536,7 @@ ProcSyncQueryCounter(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pCounter, stuff->counter, rc = dixLookupResourceByType((pointer *)&pCounter, stuff->counter,
RTCounter, client, DixReadAccess); RTCounter, client, DixReadAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? SyncErrorBase + XSyncBadCounter : rc; return rc;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
@ -1668,7 +1660,7 @@ ProcSyncChangeAlarm(ClientPtr client)
status = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm, status = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm,
client, DixWriteAccess); client, DixWriteAccess);
if (status != Success) if (status != Success)
return (status == BadValue) ? SyncErrorBase + XSyncBadAlarm : status; return status;
vmask = stuff->valueMask; vmask = stuff->valueMask;
len = client->req_len - bytes_to_int32(sizeof(xSyncChangeAlarmReq)); len = client->req_len - bytes_to_int32(sizeof(xSyncChangeAlarmReq));
@ -1707,7 +1699,7 @@ ProcSyncQueryAlarm(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm, rc = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm,
client, DixReadAccess); client, DixReadAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? SyncErrorBase + XSyncBadAlarm : rc; return rc;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply)); rep.length = bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply));
@ -1764,7 +1756,7 @@ ProcSyncDestroyAlarm(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm, rc = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm,
client, DixDestroyAccess); client, DixDestroyAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? SyncErrorBase + XSyncBadAlarm : rc; return rc;
FreeResource(stuff->alarm, RT_NONE); FreeResource(stuff->alarm, RT_NONE);
return Success; return Success;
@ -2135,6 +2127,9 @@ SyncExtensionInit(void)
EventSwapVector[SyncEventBase + XSyncCounterNotify] = (EventSwapPtr) SCounterNotifyEvent; EventSwapVector[SyncEventBase + XSyncCounterNotify] = (EventSwapPtr) SCounterNotifyEvent;
EventSwapVector[SyncEventBase + XSyncAlarmNotify] = (EventSwapPtr) SAlarmNotifyEvent; EventSwapVector[SyncEventBase + XSyncAlarmNotify] = (EventSwapPtr) SAlarmNotifyEvent;
SetResourceTypeErrorValue(RTCounter, SyncErrorBase + XSyncBadCounter);
SetResourceTypeErrorValue(RTAlarm, SyncErrorBase + XSyncBadAlarm);
/* /*
* Although SERVERTIME is implemented by the OS layer, we initialise it * Although SERVERTIME is implemented by the OS layer, we initialise it
* here because doing it in OsInit() is too early. The resource database * here because doing it in OsInit() is too early. The resource database

View File

@ -54,13 +54,11 @@ xcalibrate_event_hook (int x, int y, int pressure, void *closure)
xXCalibrateRawTouchscreenEvent ev; xXCalibrateRawTouchscreenEvent ev;
ev.type = XCalibrateEventBase + X_XCalibrateRawTouchscreen; ev.type = XCalibrateEventBase + X_XCalibrateRawTouchscreen;
ev.sequenceNumber = pClient->sequence;
ev.x = x; ev.x = x;
ev.y = y; ev.y = y;
ev.pressure = pressure; ev.pressure = pressure;
if (!pClient->clientGone) WriteEventsToClient (pClient, 1, (xEvent *) &ev);
WriteEventsToClient (pClient, 1, (xEvent *) &ev);
} }
static int static int

View File

@ -153,7 +153,7 @@ ProcXTestCompareCursor(ClientPtr client)
if (rc != Success) if (rc != Success)
{ {
client->errorValue = stuff->cursor; client->errorValue = stuff->cursor;
return (rc == BadValue) ? BadCursor : rc; return rc;
} }
} }
rep.type = X_Reply; rep.type = X_Reply;

View File

@ -1025,7 +1025,6 @@ typedef struct _ShmDesc {
} ShmDescRec, *ShmDescPtr; } ShmDescRec, *ShmDescPtr;
extern RESTYPE ShmSegType; extern RESTYPE ShmSegType;
extern int BadShmSegCode;
extern int ShmCompletionCode; extern int ShmCompletionCode;
static int static int
@ -1077,7 +1076,7 @@ ProcXvShmPutImage(ClientPtr client)
status = dixLookupResourceByType((pointer *)&shmdesc, stuff->shmseg, status = dixLookupResourceByType((pointer *)&shmdesc, stuff->shmseg,
ShmSegType, serverClient, DixReadAccess); ShmSegType, serverClient, DixReadAccess);
if (status != Success) if (status != Success)
return (status == BadValue) ? BadShmSegCode : status; return status;
width = stuff->width; width = stuff->width;
height = stuff->height; height = stuff->height;
@ -1100,7 +1099,6 @@ ProcXvShmPutImage(ClientPtr client)
ev.type = ShmCompletionCode; ev.type = ShmCompletionCode;
ev.drawable = stuff->drawable; ev.drawable = stuff->drawable;
ev.sequenceNumber = client->sequence;
ev.minorEvent = xv_ShmPutImage; ev.minorEvent = xv_ShmPutImage;
ev.majorEvent = XvReqCode; ev.majorEvent = XvReqCode;
ev.shmseg = stuff->shmseg; ev.shmseg = stuff->shmseg;
@ -1616,7 +1614,7 @@ XineramaXvStopVideo(ClientPtr client)
result = dixLookupResourceByType((pointer *)&port, stuff->port, result = dixLookupResourceByType((pointer *)&port, stuff->port,
XvXRTPort, client, DixReadAccess); XvXRTPort, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? _XvBadPort : result; return result;
FOR_NSCREENS_BACKWARD(i) { FOR_NSCREENS_BACKWARD(i) {
if(port->info[i].id) { if(port->info[i].id) {
@ -1641,7 +1639,7 @@ XineramaXvSetPortAttribute(ClientPtr client)
result = dixLookupResourceByType((pointer *)&port, stuff->port, result = dixLookupResourceByType((pointer *)&port, stuff->port,
XvXRTPort, client, DixReadAccess); XvXRTPort, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? _XvBadPort : result; return result;
FOR_NSCREENS_BACKWARD(i) { FOR_NSCREENS_BACKWARD(i) {
if(port->info[i].id) { if(port->info[i].id) {
@ -1672,12 +1670,12 @@ XineramaXvShmPutImage(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, result = dixLookupResourceByType((pointer *)&gc, stuff->gc,
XRT_GC, client, DixReadAccess); XRT_GC, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
result = dixLookupResourceByType((pointer *)&port, stuff->port, result = dixLookupResourceByType((pointer *)&port, stuff->port,
XvXRTPort, client, DixReadAccess); XvXRTPort, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? _XvBadPort : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1724,12 +1722,12 @@ XineramaXvPutImage(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, result = dixLookupResourceByType((pointer *)&gc, stuff->gc,
XRT_GC, client, DixReadAccess); XRT_GC, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
result = dixLookupResourceByType((pointer *)&port, stuff->port, result = dixLookupResourceByType((pointer *)&port, stuff->port,
XvXRTPort, client, DixReadAccess); XvXRTPort, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? _XvBadPort : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1772,12 +1770,12 @@ XineramaXvPutVideo(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, result = dixLookupResourceByType((pointer *)&gc, stuff->gc,
XRT_GC, client, DixReadAccess); XRT_GC, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
result = dixLookupResourceByType((pointer *)&port, stuff->port, result = dixLookupResourceByType((pointer *)&port, stuff->port,
XvXRTPort, client, DixReadAccess); XvXRTPort, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? _XvBadPort : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1820,12 +1818,12 @@ XineramaXvPutStill(ClientPtr client)
result = dixLookupResourceByType((pointer *)&gc, stuff->gc, result = dixLookupResourceByType((pointer *)&gc, stuff->gc,
XRT_GC, client, DixReadAccess); XRT_GC, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? BadGC : result; return result;
result = dixLookupResourceByType((pointer *)&port, stuff->port, result = dixLookupResourceByType((pointer *)&port, stuff->port,
XvXRTPort, client, DixReadAccess); XvXRTPort, client, DixReadAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? _XvBadPort : result; return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
@ -1911,6 +1909,7 @@ void XineramifyXv(void)
XvXRTPort = CreateNewResourceType(XineramaDeleteResource, "XvXRTPort"); XvXRTPort = CreateNewResourceType(XineramaDeleteResource, "XvXRTPort");
if (!xvsp0 || !XvXRTPort) return; if (!xvsp0 || !XvXRTPort) return;
SetResourceTypeErrorValue(XvXRTPort, _XvBadPort);
for(i = 0; i < xvsp0->nAdaptors; i++) { for(i = 0; i < xvsp0->nAdaptors; i++) {
Bool isOverlay; Bool isOverlay;

View File

@ -206,7 +206,7 @@ typedef struct _XvPortRec {
int rc = dixLookupResourceByType((pointer *)&(pPort), portID,\ int rc = dixLookupResourceByType((pointer *)&(pPort), portID,\
XvRTPort, client, mode);\ XvRTPort, client, mode);\
if (rc != Success)\ if (rc != Success)\
return (rc == BadValue) ? _XvBadPort : rc;\ return rc;\
} }
typedef struct { typedef struct {

View File

@ -192,6 +192,7 @@ XvExtensionInit(void)
EventSwapVector[XvEventBase+XvPortNotify] = EventSwapVector[XvEventBase+XvPortNotify] =
(EventSwapPtr)WriteSwappedPortNotifyEvent; (EventSwapPtr)WriteSwappedPortNotifyEvent;
SetResourceTypeErrorValue(XvRTPort, _XvBadPort);
(void)MakeAtom(XvName, strlen(XvName), xTrue); (void)MakeAtom(XvName, strlen(XvName), xTrue);
} }
@ -530,17 +531,12 @@ XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason)
while (pn) while (pn)
{ {
if (pn->client) event.u.u.type = XvEventBase + XvVideoNotify;
{ event.u.videoNotify.time = currentTime.milliseconds;
event.u.u.type = XvEventBase + XvVideoNotify; event.u.videoNotify.drawable = pDraw->id;
event.u.u.sequenceNumber = pn->client->sequence; event.u.videoNotify.port = pPort->id;
event.u.videoNotify.time = currentTime.milliseconds; event.u.videoNotify.reason = reason;
event.u.videoNotify.drawable = pDraw->id; WriteEventsToClient(pn->client, 1, (xEventPtr)&event);
event.u.videoNotify.port = pPort->id;
event.u.videoNotify.reason = reason;
TryClientEvents(pn->client, NULL, (xEventPtr)&event, 1,
NoEventMask, NoEventMask, NullGrab);
}
pn = pn->next; pn = pn->next;
} }
@ -562,17 +558,12 @@ XvdiSendPortNotify(
while (pn) while (pn)
{ {
if (pn->client) event.u.u.type = XvEventBase + XvPortNotify;
{ event.u.portNotify.time = currentTime.milliseconds;
event.u.u.type = XvEventBase + XvPortNotify; event.u.portNotify.port = pPort->id;
event.u.u.sequenceNumber = pn->client->sequence; event.u.portNotify.attribute = attribute;
event.u.portNotify.time = currentTime.milliseconds; event.u.portNotify.value = value;
event.u.portNotify.port = pPort->id; WriteEventsToClient(pn->client, 1, (xEventPtr)&event);
event.u.portNotify.attribute = attribute;
event.u.portNotify.value = value;
TryClientEvents(pn->client, NULL, (xEventPtr)&event, 1,
NoEventMask, NoEventMask, NullGrab);
}
pn = pn->next; pn = pn->next;
} }

View File

@ -40,7 +40,6 @@ unsigned long XvMCGeneration = 0;
int XvMCReqCode; int XvMCReqCode;
int XvMCEventBase; int XvMCEventBase;
int XvMCErrorBase;
unsigned long XvMCRTContext; unsigned long XvMCRTContext;
unsigned long XvMCRTSurface; unsigned long XvMCRTSurface;
@ -276,7 +275,7 @@ ProcXvMCDestroyContext(ClientPtr client)
rc = dixLookupResourceByType(&val, stuff->context_id, XvMCRTContext, rc = dixLookupResourceByType(&val, stuff->context_id, XvMCRTContext,
client, DixDestroyAccess); client, DixDestroyAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? XvMCBadContext + XvMCErrorBase : rc; return rc;
FreeResource(stuff->context_id, RT_NONE); FreeResource(stuff->context_id, RT_NONE);
@ -299,7 +298,7 @@ ProcXvMCCreateSurface(ClientPtr client)
result = dixLookupResourceByType((pointer *)&pContext, stuff->context_id, result = dixLookupResourceByType((pointer *)&pContext, stuff->context_id,
XvMCRTContext, client, DixUseAccess); XvMCRTContext, client, DixUseAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? XvMCBadContext + XvMCErrorBase : result; return result;
pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen); pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
@ -346,7 +345,7 @@ ProcXvMCDestroySurface(ClientPtr client)
rc = dixLookupResourceByType(&val, stuff->surface_id, XvMCRTSurface, rc = dixLookupResourceByType(&val, stuff->surface_id, XvMCRTSurface,
client, DixDestroyAccess); client, DixDestroyAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? XvMCBadSurface + XvMCErrorBase : rc; return rc;
FreeResource(stuff->surface_id, RT_NONE); FreeResource(stuff->surface_id, RT_NONE);
@ -371,7 +370,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
result = dixLookupResourceByType((pointer *)&pContext, stuff->context_id, result = dixLookupResourceByType((pointer *)&pContext, stuff->context_id,
XvMCRTContext, client, DixUseAccess); XvMCRTContext, client, DixUseAccess);
if (result != Success) if (result != Success)
return (result == BadValue) ? XvMCBadContext + XvMCErrorBase : result; return result;
pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen); pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
@ -463,7 +462,7 @@ ProcXvMCDestroySubpicture(ClientPtr client)
rc = dixLookupResourceByType(&val, stuff->subpicture_id, XvMCRTSubpicture, rc = dixLookupResourceByType(&val, stuff->subpicture_id, XvMCRTSubpicture,
client, DixDestroyAccess); client, DixDestroyAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? XvMCBadSubpicture + XvMCErrorBase : rc; return rc;
FreeResource(stuff->subpicture_id, RT_NONE); FreeResource(stuff->subpicture_id, RT_NONE);
@ -694,7 +693,9 @@ XvMCExtensionInit(void)
XvMCReqCode = extEntry->base; XvMCReqCode = extEntry->base;
XvMCEventBase = extEntry->eventBase; XvMCEventBase = extEntry->eventBase;
XvMCErrorBase = extEntry->errorBase; SetResourceTypeErrorValue(XvMCRTContext, extEntry->errorBase + XvMCBadContext);
SetResourceTypeErrorValue(XvMCRTSurface, extEntry->errorBase + XvMCBadSurface);
SetResourceTypeErrorValue(XvMCRTSubpicture, extEntry->errorBase + XvMCBadSubpicture);
} }
static Bool static Bool

View File

@ -1445,7 +1445,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device,
if (rc != Success) if (rc != Success)
{ {
client->errorValue = param->cursor; client->errorValue = param->cursor;
return (rc == BadValue) ? BadCursor : rc; return rc;
} }
access_mode |= DixForceAccess; access_mode |= DixForceAccess;
} }
@ -1543,7 +1543,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type,
if (rc != Success) if (rc != Success)
{ {
client->errorValue = param->cursor; client->errorValue = param->cursor;
return (rc == BadValue) ? BadCursor : rc; return rc;
} }
access_mode |= DixForceAccess; access_mode |= DixForceAccess;
} }

View File

@ -103,7 +103,7 @@ int ProcXIChangeCursor(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pCursor, stuff->cursor, rc = dixLookupResourceByType((pointer *)&pCursor, stuff->cursor,
RT_CURSOR, client, DixUseAccess); RT_CURSOR, client, DixUseAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? BadCursor : rc; return rc;
} }
ChangeWindowDeviceCursor(pWin, pDev, pCursor); ChangeWindowDeviceCursor(pWin, pDev, pCursor);

View File

@ -147,7 +147,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
if (status != Success) if (status != Success)
{ {
client->errorValue = stuff->cursor; client->errorValue = stuff->cursor;
return (status == BadValue) ? BadCursor : status; return status;
} }
} }

View File

@ -140,10 +140,7 @@ ProcCompositeQueryVersion (ClientPtr client)
int err; \ int err; \
err = dixLookupResourceByType((pointer *) &pWindow, wid, \ err = dixLookupResourceByType((pointer *) &pWindow, wid, \
RT_WINDOW, client, mode); \ RT_WINDOW, client, mode); \
if (err == BadValue) { \ if (err != Success) { \
client->errorValue = wid; \
return BadWindow; \
} else if (err != Success) { \
client->errorValue = wid; \ client->errorValue = wid; \
return err; \ return err; \
} \ } \

View File

@ -29,7 +29,6 @@
static unsigned char DamageReqCode; static unsigned char DamageReqCode;
static int DamageEventBase; static int DamageEventBase;
static int DamageErrorBase;
static RESTYPE DamageExtType; static RESTYPE DamageExtType;
static RESTYPE DamageExtWinType; static RESTYPE DamageExtWinType;
@ -50,7 +49,6 @@ DamageExtNotify (DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
UpdateCurrentTimeIf (); UpdateCurrentTimeIf ();
ev.type = DamageEventBase + XDamageNotify; ev.type = DamageEventBase + XDamageNotify;
ev.level = pDamageExt->level; ev.level = pDamageExt->level;
ev.sequenceNumber = pClient->sequence;
ev.drawable = pDamageExt->drawable; ev.drawable = pDamageExt->drawable;
ev.damage = pDamageExt->id; ev.damage = pDamageExt->id;
ev.timestamp = currentTime.milliseconds; ev.timestamp = currentTime.milliseconds;
@ -69,8 +67,7 @@ DamageExtNotify (DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
ev.area.y = pBoxes[i].y1; ev.area.y = pBoxes[i].y1;
ev.area.width = pBoxes[i].x2 - pBoxes[i].x1; ev.area.width = pBoxes[i].x2 - pBoxes[i].x1;
ev.area.height = pBoxes[i].y2 - pBoxes[i].y1; ev.area.height = pBoxes[i].y2 - pBoxes[i].y1;
if (!pClient->clientGone) WriteEventsToClient (pClient, 1, (xEvent *) &ev);
WriteEventsToClient (pClient, 1, (xEvent *) &ev);
} }
} }
else else
@ -79,8 +76,7 @@ DamageExtNotify (DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
ev.area.y = 0; ev.area.y = 0;
ev.area.width = pDrawable->width; ev.area.width = pDrawable->width;
ev.area.height = pDrawable->height; ev.area.height = pDrawable->height;
if (!pClient->clientGone) WriteEventsToClient (pClient, 1, (xEvent *) &ev);
WriteEventsToClient (pClient, 1, (xEvent *) &ev);
} }
/* Composite extension marks clients with manual Subwindows as critical */ /* Composite extension marks clients with manual Subwindows as critical */
if (pDamageClient->critical > 0) if (pDamageClient->critical > 0)
@ -518,8 +514,8 @@ DamageExtensionInit(void)
{ {
DamageReqCode = (unsigned char)extEntry->base; DamageReqCode = (unsigned char)extEntry->base;
DamageEventBase = extEntry->eventBase; DamageEventBase = extEntry->eventBase;
DamageErrorBase = extEntry->errorBase;
EventSwapVector[DamageEventBase + XDamageNotify] = EventSwapVector[DamageEventBase + XDamageNotify] =
(EventSwapPtr) SDamageNotifyEvent; (EventSwapPtr) SDamageNotifyEvent;
SetResourceTypeErrorValue(DamageExtType, extEntry->errorBase + BadDamage);
} }
} }

View File

@ -62,7 +62,7 @@ typedef struct _DamageExt {
int rc = dixLookupResourceByType((pointer *)&(pDamageExt), rid, \ int rc = dixLookupResourceByType((pointer *)&(pDamageExt), rid, \
DamageExtType, client, mode); \ DamageExtType, client, mode); \
if (rc != Success) \ if (rc != Success) \
return (rc == BadValue) ? DamageErrorBase + BadDamage : rc; \ return rc; \
} }
void void

View File

@ -422,12 +422,12 @@ ProcDbeDeallocateBackBufferName(ClientPtr client)
dbeWindowPrivResType, client, dbeWindowPrivResType, client,
DixDestroyAccess); DixDestroyAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? dbeErrorBase + DbeBadBuffer : rc; return rc;
rc = dixLookupResourceByType(&val, stuff->buffer, dbeDrawableResType, rc = dixLookupResourceByType(&val, stuff->buffer, dbeDrawableResType,
client, DixDestroyAccess); client, DixDestroyAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? dbeErrorBase + DbeBadBuffer : rc; return rc;
/* Make sure that the id is valid for the window. /* Make sure that the id is valid for the window.
* This is paranoid code since we already looked up the ID by type * This is paranoid code since we already looked up the ID by type
@ -1672,6 +1672,8 @@ DbeExtensionInit(void)
DbeResetProc, StandardMinorOpcode); DbeResetProc, StandardMinorOpcode);
dbeErrorBase = extEntry->errorBase; dbeErrorBase = extEntry->errorBase;
SetResourceTypeErrorValue(dbeWindowPrivResType, dbeErrorBase + DbeBadBuffer);
SetResourceTypeErrorValue(dbeDrawableResType, dbeErrorBase + DbeBadBuffer);
} /* DbeExtensionInit() */ } /* DbeExtensionInit() */

View File

@ -316,14 +316,14 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
if (rc != Success) if (rc != Success)
{ {
client->errorValue = source; client->errorValue = source;
return (rc == BadValue) ? BadFont : rc; return rc;
} }
rc = dixLookupResourceByType((pointer *)&maskfont, mask, RT_FONT, client, rc = dixLookupResourceByType((pointer *)&maskfont, mask, RT_FONT, client,
DixUseAccess); DixUseAccess);
if (rc != Success && mask != None) if (rc != Success && mask != None)
{ {
client->errorValue = mask; client->errorValue = mask;
return (rc == BadValue) ? BadFont : rc; return rc;
} }
if (sourcefont != maskfont) if (sourcefont != maskfont)
pShare = (GlyphSharePtr)NULL; pShare = (GlyphSharePtr)NULL;

View File

@ -1240,7 +1240,7 @@ ProcCloseFont(ClientPtr client)
else else
{ {
client->errorValue = stuff->id; client->errorValue = stuff->id;
return (rc == BadValue) ? BadFont : rc; return rc;
} }
} }
@ -1453,7 +1453,7 @@ ProcFreePixmap(ClientPtr client)
else else
{ {
client->errorValue = stuff->id; client->errorValue = stuff->id;
return (rc == BadValue) ? BadPixmap : rc; return rc;
} }
} }
@ -2407,7 +2407,7 @@ ProcFreeColormap(ClientPtr client)
else else
{ {
client->errorValue = stuff->id; client->errorValue = stuff->id;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
} }
@ -2428,7 +2428,7 @@ ProcCopyColormapAndFree(ClientPtr client)
if (rc == Success) if (rc == Success)
return CopyColormapAndFree(mid, pSrcMap, client->index); return CopyColormapAndFree(mid, pSrcMap, client->index);
client->errorValue = stuff->srcCmap; client->errorValue = stuff->srcCmap;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
int int
@ -2445,15 +2445,18 @@ ProcInstallColormap(ClientPtr client)
goto out; goto out;
rc = XaceHook(XACE_SCREEN_ACCESS, client, pcmp->pScreen, DixSetAttrAccess); rc = XaceHook(XACE_SCREEN_ACCESS, client, pcmp->pScreen, DixSetAttrAccess);
if (rc != Success) if (rc != Success) {
if (rc == BadValue)
rc = BadColor;
goto out; goto out;
}
(*(pcmp->pScreen->InstallColormap)) (pcmp); (*(pcmp->pScreen->InstallColormap)) (pcmp);
return Success; return Success;
out: out:
client->errorValue = stuff->id; client->errorValue = stuff->id;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
int int
@ -2470,8 +2473,11 @@ ProcUninstallColormap(ClientPtr client)
goto out; goto out;
rc = XaceHook(XACE_SCREEN_ACCESS, client, pcmp->pScreen, DixSetAttrAccess); rc = XaceHook(XACE_SCREEN_ACCESS, client, pcmp->pScreen, DixSetAttrAccess);
if (rc != Success) if (rc != Success) {
if (rc == BadValue)
rc = BadColor;
goto out; goto out;
}
if(pcmp->mid != pcmp->pScreen->defColormap) if(pcmp->mid != pcmp->pScreen->defColormap)
(*(pcmp->pScreen->UninstallColormap)) (pcmp); (*(pcmp->pScreen->UninstallColormap)) (pcmp);
@ -2479,7 +2485,7 @@ ProcUninstallColormap(ClientPtr client)
out: out:
client->errorValue = stuff->id; client->errorValue = stuff->id;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
int int
@ -2552,7 +2558,7 @@ ProcAllocColor (ClientPtr client)
else else
{ {
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
} }
@ -2598,7 +2604,7 @@ ProcAllocNamedColor (ClientPtr client)
else else
{ {
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
} }
@ -2662,7 +2668,7 @@ ProcAllocColorCells (ClientPtr client)
else else
{ {
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
} }
@ -2724,7 +2730,7 @@ ProcAllocColorPlanes(ClientPtr client)
else else
{ {
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
} }
@ -2751,7 +2757,7 @@ ProcFreeColors(ClientPtr client)
else else
{ {
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
} }
@ -2778,7 +2784,7 @@ ProcStoreColors (ClientPtr client)
else else
{ {
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
} }
@ -2808,7 +2814,7 @@ ProcStoreNamedColor (ClientPtr client)
else else
{ {
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
} }
@ -2855,7 +2861,7 @@ ProcQueryColors(ClientPtr client)
else else
{ {
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
} }
@ -2894,7 +2900,7 @@ ProcLookupColor(ClientPtr client)
else else
{ {
client->errorValue = stuff->cmap; client->errorValue = stuff->cmap;
return (rc == BadValue) ? BadColor : rc; return rc;
} }
} }
@ -2920,7 +2926,7 @@ ProcCreateCursor (ClientPtr client)
DixReadAccess); DixReadAccess);
if (rc != Success) { if (rc != Success) {
client->errorValue = stuff->source; client->errorValue = stuff->source;
return (rc == BadValue) ? BadPixmap : rc; return rc;
} }
rc = dixLookupResourceByType((pointer *)&msk, stuff->mask, RT_PIXMAP, client, rc = dixLookupResourceByType((pointer *)&msk, stuff->mask, RT_PIXMAP, client,
@ -2930,7 +2936,7 @@ ProcCreateCursor (ClientPtr client)
if (stuff->mask != None) if (stuff->mask != None)
{ {
client->errorValue = stuff->mask; client->errorValue = stuff->mask;
return (rc == BadValue) ? BadPixmap : rc; return rc;
} }
} }
else if ( src->drawable.width != msk->drawable.width else if ( src->drawable.width != msk->drawable.width
@ -3031,7 +3037,7 @@ ProcFreeCursor (ClientPtr client)
else else
{ {
client->errorValue = stuff->id; client->errorValue = stuff->id;
return (rc == BadValue) ? BadCursor : rc; return rc;
} }
} }
@ -3741,7 +3747,6 @@ SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode,
memset(&rep, 0, sizeof(xError)); memset(&rep, 0, sizeof(xError));
rep.type = X_Error; rep.type = X_Error;
rep.sequenceNumber = client->sequence;
rep.errorCode = errorCode; rep.errorCode = errorCode;
rep.majorCode = majorCode; rep.majorCode = majorCode;
rep.minorCode = minorCode; rep.minorCode = minorCode;

View File

@ -1238,7 +1238,6 @@ doPolyText(ClientPtr client, PTclosurePtr c)
client, DixUseAccess); client, DixUseAccess);
if (err != Success) if (err != Success)
{ {
err = (err == BadValue) ? BadFont : err;
/* restore pFont and fid for step 4 (described below) */ /* restore pFont and fid for step 4 (described below) */
pFont = oldpFont; pFont = oldpFont;
fid = oldfid; fid = oldfid;

View File

@ -231,9 +231,7 @@ dixLookupWindow(WindowPtr *pWin, XID id, ClientPtr client, Mask access)
int int
dixLookupGC(GCPtr *pGC, XID id, ClientPtr client, Mask access) dixLookupGC(GCPtr *pGC, XID id, ClientPtr client, Mask access)
{ {
int rc; return dixLookupResourceByType((pointer *)pGC, id, RT_GC, client, access);
rc = dixLookupResourceByType((pointer *)pGC, id, RT_GC, client, access);
return (rc == BadValue) ? BadGC : rc;
} }
int int
@ -243,10 +241,10 @@ dixLookupFontable(FontPtr *pFont, XID id, ClientPtr client, Mask access)
GC *pGC; GC *pGC;
client->errorValue = id; /* EITHER font or gc */ client->errorValue = id; /* EITHER font or gc */
rc = dixLookupResourceByType((pointer *) pFont, id, RT_FONT, client, access); rc = dixLookupResourceByType((pointer *) pFont, id, RT_FONT, client, access);
if (rc != BadValue) if (rc != BadFont)
return rc; return rc;
rc = dixLookupResourceByType((pointer *) &pGC, id, RT_GC, client, access); rc = dixLookupResourceByType((pointer *) &pGC, id, RT_GC, client, access);
if (rc == BadValue) if (rc == BadGC)
return BadFont; return BadFont;
if (rc == Success) if (rc == Success)
*pFont = pGC->font; *pFont = pGC->font;

View File

@ -1841,7 +1841,6 @@ int
TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents, TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
int count, Mask mask, Mask filter, GrabPtr grab) int count, Mask mask, Mask filter, GrabPtr grab)
{ {
int i;
int type; int type;
#ifdef DEBUG_EVENTS #ifdef DEBUG_EVENTS
@ -1908,7 +1907,6 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
{ {
xEvent release = *pEvents; xEvent release = *pEvents;
release.u.u.type = KeyRelease; release.u.u.type = KeyRelease;
release.u.u.sequenceNumber = client->sequence;
WriteEventsToClient(client, 1, &release); WriteEventsToClient(client, 1, &release);
#ifdef DEBUG_EVENTS #ifdef DEBUG_EVENTS
ErrorF(" (plus fake core release for repeat)"); ErrorF(" (plus fake core release for repeat)");
@ -1929,7 +1927,6 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
{ {
deviceKeyButtonPointer release = *(deviceKeyButtonPointer *)pEvents; deviceKeyButtonPointer release = *(deviceKeyButtonPointer *)pEvents;
release.type = DeviceKeyRelease; release.type = DeviceKeyRelease;
release.sequenceNumber = client->sequence;
#ifdef DEBUG_EVENTS #ifdef DEBUG_EVENTS
ErrorF(" (plus fake xi1 release for repeat)"); ErrorF(" (plus fake xi1 release for repeat)");
#endif #endif
@ -1943,14 +1940,6 @@ TryClientEvents (ClientPtr client, DeviceIntPtr dev, xEvent *pEvents,
} }
} }
type &= 0177;
if (type != KeymapNotify)
{
/* all extension events must have a sequence number */
for (i = 0; i < count; i++)
pEvents[i].u.u.sequenceNumber = client->sequence;
}
if (BitIsOn(criticalEvents, type)) if (BitIsOn(criticalEvents, type))
{ {
if (client->smart_priority < SMART_MAX_PRIORITY) if (client->smart_priority < SMART_MAX_PRIORITY)
@ -4708,7 +4697,7 @@ ProcChangeActivePointerGrab(ClientPtr client)
if (rc != Success) if (rc != Success)
{ {
client->errorValue = stuff->cursor; client->errorValue = stuff->cursor;
return (rc == BadValue) ? BadCursor : rc; return rc;
} }
} }
@ -4831,7 +4820,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
if (rc != Success) if (rc != Success)
{ {
client->errorValue = curs; client->errorValue = curs;
return (rc == BadValue) ? BadCursor : rc; return rc;
} }
access_mode |= DixForceAccess; access_mode |= DixForceAccess;
} }
@ -5356,7 +5345,7 @@ ProcGrabButton(ClientPtr client)
if (rc != Success) if (rc != Success)
{ {
client->errorValue = stuff->cursor; client->errorValue = stuff->cursor;
return (rc == BadValue) ? BadCursor : rc; return rc;
} }
access_mode |= DixForceAccess; access_mode |= DixForceAccess;
} }
@ -5619,7 +5608,7 @@ ProcRecolorCursor(ClientPtr client)
if (rc != Success) if (rc != Success)
{ {
client->errorValue = stuff->cursor; client->errorValue = stuff->cursor;
return (rc == BadValue) ? BadCursor : rc; return rc;
} }
pCursor->foreRed = stuff->foreRed; pCursor->foreRed = stuff->foreRed;
@ -5669,6 +5658,13 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
int i, int i,
eventlength = sizeof(xEvent); eventlength = sizeof(xEvent);
if (!pClient || pClient == serverClient || pClient->clientGone)
return;
for (i = 0; i < count; i++)
if ((events[i].u.u.type & 0x7f) != KeymapNotify)
events[i].u.u.sequenceNumber = pClient->sequence;
/* Let XKB rewrite the state, as it depends on client preferences. */ /* Let XKB rewrite the state, as it depends on client preferences. */
XkbFilterEvents(pClient, count, events); XkbFilterEvents(pClient, count, events);

View File

@ -458,8 +458,6 @@ ChangeGCXIDs(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32)
if (rc != Success) if (rc != Success)
{ {
client->errorValue = vals[offset].val; client->errorValue = vals[offset].val;
if (rc == BadValue)
rc = (xidfields[i].type == RT_PIXMAP) ? BadPixmap : BadFont;
return rc; return rc;
} }
} }

View File

@ -88,7 +88,6 @@ do_butmap_change(DeviceIntPtr dev, CARD8 *map, int len, ClientPtr client)
if (!XIShouldNotify(clients[i], dev)) if (!XIShouldNotify(clients[i], dev))
continue; continue;
core_mn.u.u.sequenceNumber = clients[i]->sequence;
WriteEventsToClient(clients[i], 1, &core_mn); WriteEventsToClient(clients[i], 1, &core_mn);
} }

View File

@ -183,7 +183,54 @@ RESTYPE lastResourceType;
static RESTYPE lastResourceClass; static RESTYPE lastResourceClass;
RESTYPE TypeMask; RESTYPE TypeMask;
static DeleteType *DeleteFuncs = (DeleteType *)NULL; struct ResourceType {
DeleteType deleteFunc;
int errorValue;
};
static struct ResourceType *resourceTypes;
static const struct ResourceType predefTypes[] = {
[RT_NONE & (RC_LASTPREDEF - 1)] = {
.deleteFunc = (DeleteType)NoopDDA,
.errorValue = BadValue,
},
[RT_WINDOW & (RC_LASTPREDEF - 1)] = {
.deleteFunc = DeleteWindow,
.errorValue = BadWindow,
},
[RT_PIXMAP & (RC_LASTPREDEF - 1)] = {
.deleteFunc = dixDestroyPixmap,
.errorValue = BadPixmap,
},
[RT_GC & (RC_LASTPREDEF - 1)] = {
.deleteFunc = FreeGC,
.errorValue = BadGC,
},
[RT_FONT & (RC_LASTPREDEF - 1)] = {
.deleteFunc = CloseFont,
.errorValue = BadFont,
},
[RT_CURSOR & (RC_LASTPREDEF - 1)] = {
.deleteFunc = FreeCursor,
.errorValue = BadCursor,
},
[RT_COLORMAP & (RC_LASTPREDEF - 1)] = {
.deleteFunc = FreeColormap,
.errorValue = BadColor,
},
[RT_CMAPENTRY & (RC_LASTPREDEF - 1)] = {
.deleteFunc = FreeClientPixels,
.errorValue = BadColor,
},
[RT_OTHERCLIENT & (RC_LASTPREDEF - 1)] = {
.deleteFunc = OtherClientGone,
.errorValue = BadValue,
},
[RT_PASSIVEGRAB & (RC_LASTPREDEF - 1)] = {
.deleteFunc = DeletePassiveGrab,
.errorValue = BadValue,
},
};
CallbackListPtr ResourceStateCallback; CallbackListPtr ResourceStateCallback;
@ -200,20 +247,20 @@ RESTYPE
CreateNewResourceType(DeleteType deleteFunc, char *name) CreateNewResourceType(DeleteType deleteFunc, char *name)
{ {
RESTYPE next = lastResourceType + 1; RESTYPE next = lastResourceType + 1;
DeleteType *funcs; struct ResourceType *types;
if (next & lastResourceClass) if (next & lastResourceClass)
return 0; return 0;
funcs = (DeleteType *)realloc(DeleteFuncs, types = realloc(resourceTypes, (next + 1) * sizeof(*resourceTypes));
(next + 1) * sizeof(DeleteType)); if (!types)
if (!funcs)
return 0; return 0;
if (!dixRegisterPrivateOffset(next, -1)) if (!dixRegisterPrivateOffset(next, -1))
return 0; return 0;
lastResourceType = next; lastResourceType = next;
DeleteFuncs = funcs; resourceTypes = types;
DeleteFuncs[next] = deleteFunc; resourceTypes[next].deleteFunc = deleteFunc;
resourceTypes[next].errorValue = BadValue;
/* Called even if name is NULL, to remove any previous entry */ /* Called even if name is NULL, to remove any previous entry */
RegisterResourceName(next, name); RegisterResourceName(next, name);
@ -221,6 +268,12 @@ CreateNewResourceType(DeleteType deleteFunc, char *name)
return next; return next;
} }
void
SetResourceTypeErrorValue(RESTYPE type, int errorValue)
{
resourceTypes[type & TypeMask].errorValue = errorValue;
}
RESTYPE RESTYPE
CreateNewResourceClass(void) CreateNewResourceClass(void)
{ {
@ -251,21 +304,11 @@ InitClientResources(ClientPtr client)
lastResourceType = RT_LASTPREDEF; lastResourceType = RT_LASTPREDEF;
lastResourceClass = RC_LASTPREDEF; lastResourceClass = RC_LASTPREDEF;
TypeMask = RC_LASTPREDEF - 1; TypeMask = RC_LASTPREDEF - 1;
if (DeleteFuncs) free(resourceTypes);
free(DeleteFuncs); resourceTypes = malloc(sizeof(predefTypes));
DeleteFuncs = malloc((lastResourceType + 1) * sizeof(DeleteType)); if (!resourceTypes)
if (!DeleteFuncs)
return FALSE; return FALSE;
DeleteFuncs[RT_NONE & TypeMask] = (DeleteType)NoopDDA; memcpy(resourceTypes, predefTypes, sizeof(predefTypes));
DeleteFuncs[RT_WINDOW & TypeMask] = DeleteWindow;
DeleteFuncs[RT_PIXMAP & TypeMask] = dixDestroyPixmap;
DeleteFuncs[RT_GC & TypeMask] = FreeGC;
DeleteFuncs[RT_FONT & TypeMask] = CloseFont;
DeleteFuncs[RT_CURSOR & TypeMask] = FreeCursor;
DeleteFuncs[RT_COLORMAP & TypeMask] = FreeColormap;
DeleteFuncs[RT_CMAPENTRY & TypeMask] = FreeClientPixels;
DeleteFuncs[RT_OTHERCLIENT & TypeMask] = OtherClientGone;
DeleteFuncs[RT_PASSIVEGRAB & TypeMask] = DeletePassiveGrab;
} }
clientTable[i = client->index].resources = clientTable[i = client->index].resources =
malloc(INITBUCKETS*sizeof(ResourcePtr)); malloc(INITBUCKETS*sizeof(ResourcePtr));
@ -462,7 +505,7 @@ AddResource(XID id, RESTYPE type, pointer value)
res = malloc(sizeof(ResourceRec)); res = malloc(sizeof(ResourceRec));
if (!res) if (!res)
{ {
(*DeleteFuncs[type & TypeMask])(value, id); (*resourceTypes[type & TypeMask].deleteFunc)(value, id);
return FALSE; return FALSE;
} }
res->next = *head; res->next = *head;
@ -557,7 +600,7 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
CallResourceStateCallback(ResourceStateFreeing, res); CallResourceStateCallback(ResourceStateFreeing, res);
if (rtype != skipDeleteFuncType) if (rtype != skipDeleteFuncType)
(*DeleteFuncs[rtype & TypeMask])(res->value, res->id); (*resourceTypes[rtype & TypeMask].deleteFunc)(res->value, res->id);
free(res); free(res);
if (*eltptr != elements) if (*eltptr != elements)
prev = head; /* prev may no longer be valid */ prev = head; /* prev may no longer be valid */
@ -594,7 +637,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree)
CallResourceStateCallback(ResourceStateFreeing, res); CallResourceStateCallback(ResourceStateFreeing, res);
if (!skipFree) if (!skipFree)
(*DeleteFuncs[type & TypeMask])(res->value, res->id); (*resourceTypes[type & TypeMask].deleteFunc)(res->value, res->id);
free(res); free(res);
break; break;
} }
@ -761,7 +804,7 @@ FreeClientNeverRetainResources(ClientPtr client)
CallResourceStateCallback(ResourceStateFreeing, this); CallResourceStateCallback(ResourceStateFreeing, this);
elements = *eltptr; elements = *eltptr;
(*DeleteFuncs[rtype & TypeMask])(this->value, this->id); (*resourceTypes[rtype & TypeMask].deleteFunc)(this->value, this->id);
free(this); free(this);
if (*eltptr != elements) if (*eltptr != elements)
prev = &resources[j]; /* prev may no longer be valid */ prev = &resources[j]; /* prev may no longer be valid */
@ -815,7 +858,7 @@ FreeClientResources(ClientPtr client)
CallResourceStateCallback(ResourceStateFreeing, this); CallResourceStateCallback(ResourceStateFreeing, this);
(*DeleteFuncs[rtype & TypeMask])(this->value, this->id); (*resourceTypes[rtype & TypeMask].deleteFunc)(this->value, this->id);
free(this); free(this);
} }
} }
@ -873,6 +916,8 @@ dixLookupResourceByType(pointer *result, XID id, RESTYPE rtype,
ResourcePtr res = NULL; ResourcePtr res = NULL;
*result = NULL; *result = NULL;
if ((rtype & TypeMask) > lastResourceType)
return BadImplementation;
if ((cid < MAXCLIENTS) && clientTable[cid].buckets) { if ((cid < MAXCLIENTS) && clientTable[cid].buckets) {
res = clientTable[cid].resources[Hash(cid, id)]; res = clientTable[cid].resources[Hash(cid, id)];
@ -882,12 +927,14 @@ dixLookupResourceByType(pointer *result, XID id, RESTYPE rtype,
break; break;
} }
if (!res) if (!res)
return BadValue; return resourceTypes[rtype & TypeMask].errorValue;
if (client) { if (client) {
client->errorValue = id; client->errorValue = id;
cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type, cid = XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type,
res->value, RT_NONE, NULL, mode); res->value, RT_NONE, NULL, mode);
if (cid == BadValue)
return resourceTypes[rtype & TypeMask].errorValue;
if (cid != Success) if (cid != Success)
return cid; return cid;
} }

View File

@ -189,8 +189,7 @@ ProcSetSelectionOwner(ClientPtr client)
event.u.selectionClear.time = time.milliseconds; event.u.selectionClear.time = time.milliseconds;
event.u.selectionClear.window = pSel->window; event.u.selectionClear.window = pSel->window;
event.u.selectionClear.atom = pSel->selection; event.u.selectionClear.atom = pSel->selection;
TryClientEvents(pSel->client, NULL, &event, 1, NoEventMask, WriteEventsToClient(pSel->client, 1, &event);
NoEventMask /* CantBeFiltered */, NullGrab);
} }
} }
else if (rc == BadMatch) else if (rc == BadMatch)
@ -296,9 +295,11 @@ ProcConvertSelection(ClientPtr client)
event.u.selectionRequest.selection = stuff->selection; event.u.selectionRequest.selection = stuff->selection;
event.u.selectionRequest.target = stuff->target; event.u.selectionRequest.target = stuff->target;
event.u.selectionRequest.property = stuff->property; event.u.selectionRequest.property = stuff->property;
if (TryClientEvents(pSel->client, NULL, &event, 1, NoEventMask, if (pSel->client && pSel->client != serverClient && !pSel->client->clientGone)
NoEventMask /* CantBeFiltered */, NullGrab)) {
WriteEventsToClient(pSel->client, 1, &event);
return Success; return Success;
}
} }
event.u.u.type = SelectionNotify; event.u.u.type = SelectionNotify;
@ -307,7 +308,6 @@ ProcConvertSelection(ClientPtr client)
event.u.selectionNotify.selection = stuff->selection; event.u.selectionNotify.selection = stuff->selection;
event.u.selectionNotify.target = stuff->target; event.u.selectionNotify.target = stuff->target;
event.u.selectionNotify.property = None; event.u.selectionNotify.property = None;
TryClientEvents(client, NULL, &event, 1, NoEventMask, WriteEventsToClient(client, 1, &event);
NoEventMask /* CantBeFiltered */, NullGrab);
return Success; return Success;
} }

View File

@ -1056,7 +1056,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
} }
else else
{ {
error = (rc == BadValue) ? BadPixmap : rc; error = rc;
client->errorValue = pixID; client->errorValue = pixID;
goto PatchUp; goto PatchUp;
} }
@ -1116,7 +1116,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
} }
else else
{ {
error = (rc == BadValue) ? BadPixmap : rc; error = rc;
client->errorValue = pixID; client->errorValue = pixID;
goto PatchUp; goto PatchUp;
} }
@ -1264,7 +1264,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
client, DixUseAccess); client, DixUseAccess);
if (rc != Success) if (rc != Success)
{ {
error = (rc == BadValue) ? BadColor : rc; error = rc;
client->errorValue = cmap; client->errorValue = cmap;
goto PatchUp; goto PatchUp;
} }
@ -1340,7 +1340,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
RT_CURSOR, client, DixUseAccess); RT_CURSOR, client, DixUseAccess);
if (rc != Success) if (rc != Success)
{ {
error = (rc == BadValue) ? BadCursor : rc; error = rc;
client->errorValue = cursorID; client->errorValue = cursorID;
goto PatchUp; goto PatchUp;
} }

View File

@ -187,7 +187,6 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
/* unknown swap completion type */ /* unknown swap completion type */
break; break;
} }
wire.sequenceNumber = client->sequence;
wire.drawable = drawable->drawId; wire.drawable = drawable->drawId;
wire.ust_hi = ust >> 32; wire.ust_hi = ust >> 32;
wire.ust_lo = ust & 0xffffffff; wire.ust_lo = ust & 0xffffffff;

View File

@ -436,7 +436,7 @@ ProcXDGAInstallColormap(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, RT_COLORMAP, rc = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, RT_COLORMAP,
client, DixInstallAccess); client, DixInstallAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? BadColor : rc; return rc;
DGAInstallCmap(cmap); DGAInstallCmap(cmap);
return Success; return Success;
} }
@ -878,7 +878,7 @@ ProcXF86DGAInstallColormap(ClientPtr client)
DGAInstallCmap(pcmp); DGAInstallCmap(pcmp);
return Success; return Success;
} else { } else {
return (rc == BadValue) ? BadColor : rc; return rc;
} }
} }

View File

@ -331,7 +331,6 @@ SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
XF86VidModeEventPtr pEv; XF86VidModeEventPtr pEv;
unsigned long mask; unsigned long mask;
xXF86VidModeNotifyEvent ev; xXF86VidModeNotifyEvent ev;
ClientPtr client;
int kind; int kind;
UpdateCurrentTimeIf (); UpdateCurrentTimeIf ();
@ -343,19 +342,15 @@ SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
kind = XF86VidModeModeChange; kind = XF86VidModeModeChange;
for (pEv = pPriv->events; pEv; pEv = pEv->next) for (pEv = pPriv->events; pEv; pEv = pEv->next)
{ {
client = pEv->client;
if (client->clientGone)
continue;
if (!(pEv->mask & mask)) if (!(pEv->mask & mask))
continue; continue;
ev.type = XF86VidModeNotify + XF86VidModeEventBase; ev.type = XF86VidModeNotify + XF86VidModeEventBase;
ev.state = state; ev.state = state;
ev.sequenceNumber = client->sequence;
ev.timestamp = currentTime.milliseconds; ev.timestamp = currentTime.milliseconds;
ev.root = WindowTable[pScreen->myNum]->drawable.id; ev.root = WindowTable[pScreen->myNum]->drawable.id;
ev.kind = kind; ev.kind = kind;
ev.forced = forced; ev.forced = forced;
WriteEventsToClient (client, 1, (xEvent *) &ev); WriteEventsToClient (pEv->client, 1, (xEvent *) &ev);
} }
} }

View File

@ -160,11 +160,7 @@ DRI2InvalidateBuffersEvent(DrawablePtr pDraw, void *priv)
xDRI2InvalidateBuffers event; xDRI2InvalidateBuffers event;
ClientPtr client = priv; ClientPtr client = priv;
if (client->clientGone)
return;
event.type = DRI2EventBase + DRI2_InvalidateBuffers; event.type = DRI2EventBase + DRI2_InvalidateBuffers;
event.sequenceNumber = client->sequence;
event.drawable = pDraw->id; event.drawable = pDraw->id;
WriteEventsToClient(client, 1, (xEvent *)&event); WriteEventsToClient(client, 1, (xEvent *)&event);
@ -366,7 +362,6 @@ DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc,
DrawablePtr pDrawable = data; DrawablePtr pDrawable = data;
event.type = DRI2EventBase + DRI2_BufferSwapComplete; event.type = DRI2EventBase + DRI2_BufferSwapComplete;
event.sequenceNumber = client->sequence;
event.event_type = type; event.event_type = type;
event.drawable = pDrawable->id; event.drawable = pDrawable->id;
event.ust_hi = (CARD64)ust >> 32; event.ust_hi = (CARD64)ust >> 32;

View File

@ -341,7 +341,6 @@ ProcAppleWMSelectInput (register ClientPtr client)
void void
AppleWMSendEvent (int type, unsigned int mask, int which, int arg) { AppleWMSendEvent (int type, unsigned int mask, int which, int arg) {
WMEventPtr *pHead, pEvent; WMEventPtr *pHead, pEvent;
ClientPtr client;
xAppleWMNotifyEvent se; xAppleWMNotifyEvent se;
int i; int i;
@ -349,18 +348,13 @@ AppleWMSendEvent (int type, unsigned int mask, int which, int arg) {
if (i != Success || !pHead) if (i != Success || !pHead)
return; return;
for (pEvent = *pHead; pEvent; pEvent = pEvent->next) { for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
client = pEvent->client; if ((pEvent->mask & mask) == 0)
if ((pEvent->mask & mask) == 0
|| client == serverClient || client->clientGone)
{
continue; continue;
}
se.type = type + WMEventBase; se.type = type + WMEventBase;
se.kind = which; se.kind = which;
se.arg = arg; se.arg = arg;
se.sequenceNumber = client->sequence;
se.time = currentTime.milliseconds; se.time = currentTime.milliseconds;
WriteEventsToClient (client, 1, (xEvent *) &se); WriteEventsToClient (pEvent->client, 1, (xEvent *) &se);
} }
} }

View File

@ -192,22 +192,16 @@ static void surface_notify(
{ {
DRISurfaceNotifyArg *arg = _arg; DRISurfaceNotifyArg *arg = _arg;
int client_index = (int) x_cvt_vptr_to_uint(data); int client_index = (int) x_cvt_vptr_to_uint(data);
ClientPtr client;
xAppleDRINotifyEvent se; xAppleDRINotifyEvent se;
if (client_index < 0 || client_index >= currentMaxClients) if (client_index < 0 || client_index >= currentMaxClients)
return; return;
client = clients[client_index];
if (client == NULL || client == serverClient || client->clientGone)
return;
se.type = DRIEventBase + AppleDRISurfaceNotify; se.type = DRIEventBase + AppleDRISurfaceNotify;
se.kind = arg->kind; se.kind = arg->kind;
se.arg = arg->id; se.arg = arg->id;
se.sequenceNumber = client->sequence;
se.time = currentTime.milliseconds; se.time = currentTime.milliseconds;
WriteEventsToClient (client, 1, (xEvent *) &se); WriteEventsToClient (clients[client_index], 1, (xEvent *) &se);
} }
static int static int

View File

@ -304,8 +304,7 @@ winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg,
#if CYGMULTIWINDOW_DEBUG #if CYGMULTIWINDOW_DEBUG
ErrorF ("winWindowsWMSendEvent - x%08x\n", (int) client); ErrorF ("winWindowsWMSendEvent - x%08x\n", (int) client);
#endif #endif
if ((pEvent->mask & mask) == 0 if ((pEvent->mask & mask) == 0)
|| client == serverClient || client->clientGone)
{ {
continue; continue;
} }
@ -320,7 +319,6 @@ winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg,
se.y = y; se.y = y;
se.w = w; se.w = w;
se.h = h; se.h = h;
se.sequenceNumber = client->sequence;
se.time = currentTime.milliseconds; se.time = currentTime.milliseconds;
WriteEventsToClient (client, 1, (xEvent *) &se); WriteEventsToClient (client, 1, (xEvent *) &se);
} }

View File

@ -157,6 +157,9 @@ typedef Bool (*FindComplexResType)(
extern _X_EXPORT RESTYPE CreateNewResourceType( extern _X_EXPORT RESTYPE CreateNewResourceType(
DeleteType /*deleteFunc*/, char * /*name*/); DeleteType /*deleteFunc*/, char * /*name*/);
extern _X_EXPORT void SetResourceTypeErrorValue(
RESTYPE /*type*/, int /*errorValue*/);
extern _X_EXPORT RESTYPE CreateNewResourceClass(void); extern _X_EXPORT RESTYPE CreateNewResourceClass(void);
extern _X_EXPORT Bool InitClientResources( extern _X_EXPORT Bool InitClientResources(

View File

@ -97,44 +97,6 @@ typedef struct {
#endif #endif
} miDCCursorRec, *miDCCursorPtr; } miDCCursorRec, *miDCCursorPtr;
/*
* sprite/cursor method table
*/
static Bool miDCRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
static Bool miDCUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
static Bool miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
CursorPtr pCursor, int x, int y,
unsigned long source, unsigned long mask);
static Bool miDCSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y,
int w, int h);
static Bool miDCRestoreUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y,
int w, int h);
static Bool miDCMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
CursorPtr pCursor, int x, int y,
int w, int h, int dx, int dy,
unsigned long source, unsigned long mask);
static Bool miDCChangeSave(DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h,
int dx, int dy);
static Bool miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
static void miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
static miSpriteCursorFuncRec miDCFuncs = {
miDCRealizeCursor,
miDCUnrealizeCursor,
miDCPutUpCursor,
miDCSaveUnderCursor,
miDCRestoreUnderCursor,
miDCMoveCursor,
miDCChangeSave,
miDCDeviceInitialize,
miDCDeviceCleanup
};
Bool Bool
miDCInitialize (ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) miDCInitialize (ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
{ {
@ -150,7 +112,7 @@ miDCInitialize (ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
dixSetPrivate(&pScreen->devPrivates, miDCScreenKey, pScreenPriv); dixSetPrivate(&pScreen->devPrivates, miDCScreenKey, pScreenPriv);
if (!miSpriteInitialize (pScreen, &miDCFuncs, screenFuncs)) if (!miSpriteInitialize (pScreen, screenFuncs))
{ {
free((pointer) pScreenPriv); free((pointer) pScreenPriv);
return FALSE; return FALSE;
@ -170,7 +132,7 @@ miDCCloseScreen (int index, ScreenPtr pScreen)
return (*pScreen->CloseScreen) (index, pScreen); return (*pScreen->CloseScreen) (index, pScreen);
} }
static Bool Bool
miDCRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor) miDCRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
{ {
if (pCursor->bits->refcnt <= 1) if (pCursor->bits->refcnt <= 1)
@ -329,7 +291,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
return pPriv; return pPriv;
} }
static Bool Bool
miDCUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor) miDCUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
{ {
miDCCursorPtr pPriv; miDCCursorPtr pPriv;
@ -426,7 +388,7 @@ miDCMakeGC(WindowPtr pWin)
} }
static Bool Bool
miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
int x, int y, unsigned long source, unsigned long mask) int x, int y, unsigned long source, unsigned long mask)
{ {
@ -471,7 +433,7 @@ miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
return TRUE; return TRUE;
} }
static Bool Bool
miDCSaveUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen, miDCSaveUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h) int x, int y, int w, int h)
{ {
@ -505,7 +467,7 @@ miDCSaveUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
return TRUE; return TRUE;
} }
static Bool Bool
miDCRestoreUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen, miDCRestoreUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h) int x, int y, int w, int h)
{ {
@ -532,7 +494,7 @@ miDCRestoreUnderCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
return TRUE; return TRUE;
} }
static Bool Bool
miDCChangeSave (DeviceIntPtr pDev, ScreenPtr pScreen, miDCChangeSave (DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h, int dx, int dy) int x, int y, int w, int h, int dx, int dy)
{ {
@ -665,7 +627,7 @@ miDCChangeSave (DeviceIntPtr pDev, ScreenPtr pScreen,
return TRUE; return TRUE;
} }
static Bool Bool
miDCMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, miDCMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
int x, int y, int w, int h, int dx, int dy, int x, int y, int w, int h, int dx, int dy,
unsigned long source, unsigned long mask) unsigned long source, unsigned long mask)
@ -764,7 +726,7 @@ miDCMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
return TRUE; return TRUE;
} }
static Bool Bool
miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
{ {
miDCBufferPtr pBuffer; miDCBufferPtr pBuffer;
@ -839,7 +801,7 @@ failure:
return FALSE; return FALSE;
} }
static void void
miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
{ {
miDCBufferPtr pBuffer; miDCBufferPtr pBuffer;

View File

@ -374,6 +374,8 @@ miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable,
pe->u.graphicsExposure.majorEvent = major; pe->u.graphicsExposure.majorEvent = major;
pe->u.graphicsExposure.minorEvent = minor; pe->u.graphicsExposure.minorEvent = minor;
} }
/* GraphicsExpose is a "critical event", which TryClientEvents
* handles specially. */
TryClientEvents(client, NULL, pEvent, numRects, TryClientEvents(client, NULL, pEvent, numRects,
(Mask)0, NoEventMask, NullGrab); (Mask)0, NoEventMask, NullGrab);
free(pEvent); free(pEvent);
@ -386,8 +388,7 @@ miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable,
event.u.noExposure.drawable = drawable; event.u.noExposure.drawable = drawable;
event.u.noExposure.majorEvent = major; event.u.noExposure.majorEvent = major;
event.u.noExposure.minorEvent = minor; event.u.noExposure.minorEvent = minor;
TryClientEvents(client, NULL, &event, 1, WriteEventsToClient(client, 1, &event);
(Mask)0, NoEventMask, NullGrab);
} }
} }

View File

@ -94,7 +94,6 @@ typedef struct {
ColormapPtr pInstalledMap; ColormapPtr pInstalledMap;
ColormapPtr pColormap; ColormapPtr pColormap;
VisualPtr pVisual; VisualPtr pVisual;
miSpriteCursorFuncPtr funcs;
DamagePtr pDamage; /* damage tracking structure */ DamagePtr pDamage; /* damage tracking structure */
Bool damageRegistered; Bool damageRegistered;
} miSpriteScreenRec, *miSpriteScreenPtr; } miSpriteScreenRec, *miSpriteScreenPtr;
@ -258,12 +257,9 @@ static void
miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
{ {
ScreenPtr pScreen = closure; ScreenPtr pScreen = closure;
miSpriteScreenPtr pScreenPriv;
miCursorInfoPtr pCursorInfo; miCursorInfoPtr pCursorInfo;
DeviceIntPtr pDev; DeviceIntPtr pDev;
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (DevHasCursor(pDev)) if (DevHasCursor(pDev))
@ -289,7 +285,6 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
Bool Bool
miSpriteInitialize (ScreenPtr pScreen, miSpriteInitialize (ScreenPtr pScreen,
miSpriteCursorFuncPtr cursorFuncs,
miPointerScreenFuncPtr screenFuncs) miPointerScreenFuncPtr screenFuncs)
{ {
miSpriteScreenPtr pScreenPriv; miSpriteScreenPtr pScreenPriv;
@ -336,7 +331,6 @@ miSpriteInitialize (ScreenPtr pScreen,
pScreenPriv->pInstalledMap = NULL; pScreenPriv->pInstalledMap = NULL;
pScreenPriv->pColormap = NULL; pScreenPriv->pColormap = NULL;
pScreenPriv->funcs = cursorFuncs;
pScreenPriv->colors[SOURCE_COLOR].red = 0; pScreenPriv->colors[SOURCE_COLOR].red = 0;
pScreenPriv->colors[SOURCE_COLOR].green = 0; pScreenPriv->colors[SOURCE_COLOR].green = 0;
pScreenPriv->colors[SOURCE_COLOR].blue = 0; pScreenPriv->colors[SOURCE_COLOR].blue = 0;
@ -397,7 +391,6 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h,
char *pdstLine) char *pdstLine)
{ {
ScreenPtr pScreen = pDrawable->pScreen; ScreenPtr pScreen = pDrawable->pScreen;
miSpriteScreenPtr pScreenPriv;
DeviceIntPtr pDev; DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo; miCursorInfoPtr pCursorInfo;
@ -405,7 +398,6 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h,
if (pDrawable->type == DRAWABLE_WINDOW) if (pDrawable->type == DRAWABLE_WINDOW)
{ {
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
for(pDev = inputInfo.devices; pDev; pDev = pDev->next) for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (DevHasCursor(pDev)) if (DevHasCursor(pDev))
@ -433,7 +425,6 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
int *pwidth, int nspans, char *pdstStart) int *pwidth, int nspans, char *pdstStart)
{ {
ScreenPtr pScreen = pDrawable->pScreen; ScreenPtr pScreen = pDrawable->pScreen;
miSpriteScreenPtr pScreenPriv;
DeviceIntPtr pDev; DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo; miCursorInfoPtr pCursorInfo;
@ -441,8 +432,6 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
if (pDrawable->type == DRAWABLE_WINDOW) if (pDrawable->type == DRAWABLE_WINDOW)
{ {
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
for(pDev = inputInfo.devices; pDev; pDev = pDev->next) for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (DevHasCursor(pDev)) if (DevHasCursor(pDev))
@ -487,7 +476,6 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
int height) int height)
{ {
ScreenPtr pScreen = pDrawable->pScreen; ScreenPtr pScreen = pDrawable->pScreen;
miSpriteScreenPtr pScreenPriv;
DeviceIntPtr pDev; DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo; miCursorInfoPtr pCursorInfo;
@ -495,8 +483,6 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
if (pDrawable->type == DRAWABLE_WINDOW) if (pDrawable->type == DRAWABLE_WINDOW)
{ {
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
for(pDev = inputInfo.devices; pDev; pDev = pDev->next) for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (DevHasCursor(pDev)) if (DevHasCursor(pDev))
@ -523,14 +509,11 @@ static void
miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{ {
ScreenPtr pScreen = pWindow->drawable.pScreen; ScreenPtr pScreen = pWindow->drawable.pScreen;
miSpriteScreenPtr pScreenPriv;
DeviceIntPtr pDev; DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo; miCursorInfoPtr pCursorInfo;
SCREEN_PROLOGUE (pScreen, CopyWindow); SCREEN_PROLOGUE (pScreen, CopyWindow);
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
for(pDev = inputInfo.devices; pDev; pDev = pDev->next) for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (DevHasCursor(pDev)) if (DevHasCursor(pDev))
@ -760,10 +743,8 @@ miSpriteFindColors (miCursorInfoPtr pDevCursor, ScreenPtr pScreen)
static Bool static Bool
miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{ {
miSpriteScreenPtr pScreenPriv;
miCursorInfoPtr pCursorInfo; miCursorInfoPtr pCursorInfo;
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
if (!IsMaster(pDev) && !pDev->u.master) if (!IsMaster(pDev) && !pDev->u.master)
return FALSE; return FALSE;
@ -772,27 +753,21 @@ miSpriteRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
if (pCursor == pCursorInfo->pCursor) if (pCursor == pCursorInfo->pCursor)
pCursorInfo->checkPixels = TRUE; pCursorInfo->checkPixels = TRUE;
return (*pScreenPriv->funcs->RealizeCursor) (pScreen, pCursor); return miDCRealizeCursor(pScreen, pCursor);
} }
static Bool static Bool
miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{ {
miSpriteScreenPtr pScreenPriv; return miDCUnrealizeCursor(pScreen, pCursor);
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
return (*pScreenPriv->funcs->UnrealizeCursor) (pScreen, pCursor);
} }
static void static void
miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
CursorPtr pCursor, int x, int y) CursorPtr pCursor, int x, int y)
{ {
miSpriteScreenPtr pScreenPriv;
miCursorInfoPtr pPointer; miCursorInfoPtr pPointer;
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
if (!IsMaster(pDev) && !pDev->u.master) if (!IsMaster(pDev) && !pDev->u.master)
return; return;
@ -861,7 +836,7 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
pointer->saved.y1 -= dy; pointer->saved.y1 -= dy;
pointer->saved.x2 -= dx; pointer->saved.x2 -= dx;
pointer->saved.y2 -= dy; pointer->saved.y2 -= dy;
(void) (*pScreenPriv->funcs->ChangeSave) (pScreen, (void) miDCChangeSave(pScreen,
pointer->saved.x1, pointer->saved.x1,
pointer->saved.y1, pointer->saved.y1,
pointer->saved.x2 - pointer->saved.x2 -
@ -870,7 +845,7 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
pointer->saved.y1, pointer->saved.y1,
dx, dy); dx, dy);
} }
(void) (*pScreenPriv->funcs->MoveCursor) (pScreen, pCursor, (void) miDCMoveCursor(pScreen, pCursor,
pointer->saved.x1, pointer->saved.x1,
pointer->saved.y1, pointer->saved.y1,
pointer->saved.x2 - pointer->saved.x2 -
@ -904,10 +879,8 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
static void static void
miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{ {
miSpriteScreenPtr pScreenPriv;
CursorPtr pCursor; CursorPtr pCursor;
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
if (!IsMaster(pDev) && !pDev->u.master) if (!IsMaster(pDev) && !pDev->u.master)
return; return;
@ -920,12 +893,9 @@ miSpriteMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
static Bool static Bool
miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen) miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
{ {
miSpriteScreenPtr pScreenPriv;
miCursorInfoPtr pCursorInfo; miCursorInfoPtr pCursorInfo;
int ret = FALSE; int ret = FALSE;
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
pCursorInfo = malloc(sizeof(miCursorInfoRec)); pCursorInfo = malloc(sizeof(miCursorInfoRec));
if (!pCursorInfo) if (!pCursorInfo)
return FALSE; return FALSE;
@ -940,7 +910,7 @@ miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
pCursorInfo->checkPixels = TRUE; pCursorInfo->checkPixels = TRUE;
pCursorInfo->pScreen = FALSE; pCursorInfo->pScreen = FALSE;
ret = (*pScreenPriv->funcs->DeviceCursorInitialize)(pDev, pScreen); ret = miDCDeviceInitialize(pDev, pScreen);
if (!ret) if (!ret)
{ {
free(pCursorInfo); free(pCursorInfo);
@ -954,13 +924,7 @@ static void
miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen) miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
{ {
if (DevHasCursor(pDev)) if (DevHasCursor(pDev))
{ miDCDeviceCleanup(pDev, pScreen);
miSpriteScreenPtr pScreenPriv;
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,
miSpriteScreenKey);
(*pScreenPriv->funcs->DeviceCursorCleanup)(pDev, pScreen);
}
} }
/* /*
@ -984,16 +948,16 @@ miSpriteRemoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
miSpriteIsDown(pCursorInfo); miSpriteIsDown(pCursorInfo);
pCursorInfo->pCacheWin = NullWindow; pCursorInfo->pCacheWin = NullWindow;
miSpriteDisableDamage(pScreen, pScreenPriv); miSpriteDisableDamage(pScreen, pScreenPriv);
if (!(*pScreenPriv->funcs->RestoreUnderCursor) (pDev, if (!miDCRestoreUnderCursor(pDev,
pScreen, pScreen,
pCursorInfo->saved.x1, pCursorInfo->saved.x1,
pCursorInfo->saved.y1, pCursorInfo->saved.y1,
pCursorInfo->saved.x2 - pCursorInfo->saved.x2 -
pCursorInfo->saved.x1, pCursorInfo->saved.x1,
pCursorInfo->saved.y2 - pCursorInfo->saved.y2 -
pCursorInfo->saved.y1)) pCursorInfo->saved.y1))
{ {
miSpriteIsUp(pCursorInfo); miSpriteIsUp(pCursorInfo);
} }
miSpriteEnableDamage(pScreen, pScreenPriv); miSpriteEnableDamage(pScreen, pScreenPriv);
DamageDrawInternal (pScreen, FALSE); DamageDrawInternal (pScreen, FALSE);
@ -1026,14 +990,14 @@ miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
y = pCursorInfo->y - (int)pCursor->bits->yhot; y = pCursorInfo->y - (int)pCursor->bits->yhot;
miSpriteDisableDamage(pScreen, pScreenPriv); miSpriteDisableDamage(pScreen, pScreenPriv);
(*pScreenPriv->funcs->SaveUnderCursor) (pDev, miDCSaveUnderCursor(pDev,
pScreen, pScreen,
pCursorInfo->saved.x1, pCursorInfo->saved.x1,
pCursorInfo->saved.y1, pCursorInfo->saved.y1,
pCursorInfo->saved.x2 - pCursorInfo->saved.x2 -
pCursorInfo->saved.x1, pCursorInfo->saved.x1,
pCursorInfo->saved.y2 - pCursorInfo->saved.y2 -
pCursorInfo->saved.y1); pCursorInfo->saved.y1);
SPRITE_DEBUG(("SaveUnderCursor %d\n", pDev->id)); SPRITE_DEBUG(("SaveUnderCursor %d\n", pDev->id));
miSpriteEnableDamage(pScreen, pScreenPriv); miSpriteEnableDamage(pScreen, pScreenPriv);
DamageDrawInternal (pScreen, FALSE); DamageDrawInternal (pScreen, FALSE);
@ -1069,7 +1033,7 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
SPRITE_DEBUG(("RestoreCursor %d\n", pDev->id)); SPRITE_DEBUG(("RestoreCursor %d\n", pDev->id));
if (pCursorInfo->checkPixels) if (pCursorInfo->checkPixels)
miSpriteFindColors (pCursorInfo, pScreen); miSpriteFindColors (pCursorInfo, pScreen);
if ((*pScreenPriv->funcs->PutUpCursor) (pDev, pScreen, if (miDCPutUpCursor(pDev, pScreen,
pCursor, x, y, pCursor, x, y,
pScreenPriv->colors[SOURCE_COLOR].pixel, pScreenPriv->colors[SOURCE_COLOR].pixel,
pScreenPriv->colors[MASK_COLOR].pixel)) pScreenPriv->colors[MASK_COLOR].pixel))
@ -1088,7 +1052,6 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen)
static void static void
miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen) miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen)
{ {
miSpriteScreenPtr pScreenPriv;
int x, y, w, h; int x, y, w, h;
int wpad, hpad; int wpad, hpad;
CursorPtr pCursor; CursorPtr pCursor;
@ -1097,7 +1060,6 @@ miSpriteComputeSaved (DeviceIntPtr pDev, ScreenPtr pScreen)
if (!IsMaster(pDev) && !pDev->u.master) if (!IsMaster(pDev) && !pDev->u.master)
return; return;
pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey);
pCursorInfo = MISPRITE(pDev); pCursorInfo = MISPRITE(pDev);
pCursor = pCursorInfo->pCursor; pCursor = pCursorInfo->pCursor;

View File

@ -32,76 +32,26 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group. in this Software without prior written authorization from The Open Group.
*/ */
typedef struct {
Bool (*RealizeCursor)(
ScreenPtr /*pScreen*/,
CursorPtr /*pCursor*/
);
Bool (*UnrealizeCursor)(
ScreenPtr /*pScreen*/,
CursorPtr /*pCursor*/
);
Bool (*PutUpCursor)(
DeviceIntPtr /*pDev*/,
ScreenPtr /*pScreen*/,
CursorPtr /*pCursor*/,
int /*x*/,
int /*y*/,
unsigned long /*source*/,
unsigned long /*mask*/
);
Bool (*SaveUnderCursor)(
DeviceIntPtr /*pDev*/,
ScreenPtr /*pScreen*/,
int /*x*/,
int /*y*/,
int /*w*/,
int /*h*/
);
Bool (*RestoreUnderCursor)(
DeviceIntPtr /*pDev*/,
ScreenPtr /*pScreen*/,
int /*x*/,
int /*y*/,
int /*w*/,
int /*h*/
);
Bool (*MoveCursor)(
DeviceIntPtr /*pDev*/,
ScreenPtr /*pScreen*/,
CursorPtr /*pCursor*/,
int /*x*/,
int /*y*/,
int /*w*/,
int /*h*/,
int /*dx*/,
int /*dy*/,
unsigned long /*source*/,
unsigned long /*mask*/
);
Bool (*ChangeSave)(
DeviceIntPtr /*pDev*/,
ScreenPtr /*pScreen*/,
int /*x*/,
int /*y*/,
int /*w*/,
int /*h*/,
int /*dx*/,
int /*dy*/
);
Bool (*DeviceCursorInitialize)(
DeviceIntPtr /*pDev*/,
ScreenPtr /*pScreen*/
);
void (*DeviceCursorCleanup)(
DeviceIntPtr /*pDev*/,
ScreenPtr /*pScreen*/
);
} miSpriteCursorFuncRec, *miSpriteCursorFuncPtr;
extern Bool miSpriteInitialize( extern Bool miSpriteInitialize(
ScreenPtr /*pScreen*/, ScreenPtr /*pScreen*/,
miSpriteCursorFuncPtr /*cursorFuncs*/,
miPointerScreenFuncPtr /*screenFuncs*/ miPointerScreenFuncPtr /*screenFuncs*/
); );
extern Bool miDCRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
extern Bool miDCUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
extern Bool miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
CursorPtr pCursor, int x, int y,
unsigned long source, unsigned long mask);
extern Bool miDCSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h);
extern Bool miDCRestoreUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h);
extern Bool miDCMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
CursorPtr pCursor, int x, int y,
int w, int h, int dx, int dy,
unsigned long source, unsigned long mask);
extern Bool miDCChangeSave(DeviceIntPtr pDev, ScreenPtr pScreen,
int x, int y, int w, int h,
int dx, int dy);
extern Bool miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
extern void miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);

View File

@ -698,15 +698,17 @@ SetCriticalOutputPending(void)
int int
WriteToClient (ClientPtr who, int count, const void *__buf) WriteToClient (ClientPtr who, int count, const void *__buf)
{ {
OsCommPtr oc = (OsCommPtr)who->osPrivate; OsCommPtr oc;
ConnectionOutputPtr oco = oc->output; ConnectionOutputPtr oco;
int padBytes; int padBytes;
const char *buf = __buf; const char *buf = __buf;
#ifdef DEBUG_COMMUNICATION #ifdef DEBUG_COMMUNICATION
Bool multicount = FALSE; Bool multicount = FALSE;
#endif #endif
if (!count) if (!count || !who || who == serverClient || who->clientGone)
return(0); return(0);
oc = who->osPrivate;
oco = oc->output;
#ifdef DEBUG_COMMUNICATION #ifdef DEBUG_COMMUNICATION
{ {
char info[128]; char info[128];

View File

@ -344,7 +344,7 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType;
RROutputType, client, a);\ RROutputType, client, a);\
if (rc != Success) {\ if (rc != Success) {\
client->errorValue = id;\ client->errorValue = id;\
return (rc == BadValue) ? RRErrorBase + BadRROutput : rc;\ return rc;\
}\ }\
} }
@ -354,7 +354,7 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType;
RRCrtcType, client, a);\ RRCrtcType, client, a);\
if (rc != Success) {\ if (rc != Success) {\
client->errorValue = id;\ client->errorValue = id;\
return (rc == BadValue) ? RRErrorBase + BadRRCrtc : rc;\ return rc;\
}\ }\
} }
@ -364,7 +364,7 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType;
RRModeType, client, a);\ RRModeType, client, a);\
if (rc != Success) {\ if (rc != Success) {\
client->errorValue = id;\ client->errorValue = id;\
return (rc == BadValue) ? RRErrorBase + BadRRMode : rc;\ return rc;\
}\ }\
} }

View File

@ -254,7 +254,6 @@ RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc)
ce.type = RRNotify + RREventBase; ce.type = RRNotify + RREventBase;
ce.subCode = RRNotify_CrtcChange; ce.subCode = RRNotify_CrtcChange;
ce.sequenceNumber = client->sequence;
ce.timestamp = pScrPriv->lastSetTime.milliseconds; ce.timestamp = pScrPriv->lastSetTime.milliseconds;
ce.window = pWin->drawable.id; ce.window = pWin->drawable.id;
ce.crtc = crtc->id; ce.crtc = crtc->id;
@ -635,6 +634,7 @@ RRCrtcInit (void)
RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource, "CRTC"); RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource, "CRTC");
if (!RRCrtcType) if (!RRCrtcType)
return FALSE; return FALSE;
SetResourceTypeErrorValue(RRCrtcType, RRErrorBase + BadRRCrtc);
return TRUE; return TRUE;
} }
@ -807,7 +807,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
{ {
if (outputs) if (outputs)
free(outputs); free(outputs);
return (rc == BadValue) ? RRErrorBase + BadRROutput : rc; return rc;
} }
/* validate crtc for this output */ /* validate crtc for this output */
for (j = 0; j < outputs[i]->numCrtcs; j++) for (j = 0; j < outputs[i]->numCrtcs; j++)

View File

@ -268,6 +268,7 @@ RRModeInit (void)
RRModeType = CreateNewResourceType (RRModeDestroyResource, "MODE"); RRModeType = CreateNewResourceType (RRModeDestroyResource, "MODE");
if (!RRModeType) if (!RRModeType)
return FALSE; return FALSE;
SetResourceTypeErrorValue(RRModeType, RRErrorBase + BadRRMode);
return TRUE; return TRUE;
} }

View File

@ -337,7 +337,6 @@ RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output)
oe.type = RRNotify + RREventBase; oe.type = RRNotify + RREventBase;
oe.subCode = RRNotify_OutputChange; oe.subCode = RRNotify_OutputChange;
oe.sequenceNumber = client->sequence;
oe.timestamp = pScrPriv->lastSetTime.milliseconds; oe.timestamp = pScrPriv->lastSetTime.milliseconds;
oe.configTimestamp = pScrPriv->lastConfigTime.milliseconds; oe.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
oe.window = pWin->drawable.id; oe.window = pWin->drawable.id;
@ -424,6 +423,7 @@ RROutputInit (void)
RROutputType = CreateNewResourceType (RROutputDestroyResource, "OUTPUT"); RROutputType = CreateNewResourceType (RROutputDestroyResource, "OUTPUT");
if (!RROutputType) if (!RROutputType)
return FALSE; return FALSE;
SetResourceTypeErrorValue(RROutputType, RRErrorBase + BadRROutput);
return TRUE; return TRUE;
} }

View File

@ -29,7 +29,6 @@ DeliverPropertyEvent(WindowPtr pWin, void *value)
{ {
xRROutputPropertyNotifyEvent *event = value; xRROutputPropertyNotifyEvent *event = value;
RREventPtr *pHead, pRREvent; RREventPtr *pHead, pRREvent;
ClientPtr client;
dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id, dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
RREventType, serverClient, DixReadAccess); RREventType, serverClient, DixReadAccess);
@ -38,14 +37,9 @@ DeliverPropertyEvent(WindowPtr pWin, void *value)
for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next)
{ {
client = pRREvent->client;
if (client == serverClient || client->clientGone)
continue;
if (!(pRREvent->mask & RROutputPropertyNotifyMask)) if (!(pRREvent->mask & RROutputPropertyNotifyMask))
continue; continue;
event->sequenceNumber = client->sequence;
event->window = pRREvent->window->drawable.id; event->window = pRREvent->window->drawable.id;
WriteEventsToClient(pRREvent->client, 1, (xEvent *)event); WriteEventsToClient(pRREvent->client, 1, (xEvent *)event);
} }

View File

@ -102,13 +102,11 @@ RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen)
se.type = RRScreenChangeNotify + RREventBase; se.type = RRScreenChangeNotify + RREventBase;
se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0); se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0);
se.timestamp = pScrPriv->lastSetTime.milliseconds; se.timestamp = pScrPriv->lastSetTime.milliseconds;
se.sequenceNumber = client->sequence;
se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; se.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
se.root = pRoot->drawable.id; se.root = pRoot->drawable.id;
se.window = pWin->drawable.id; se.window = pWin->drawable.id;
se.subpixelOrder = PictureGetSubpixelOrder (pScreen); se.subpixelOrder = PictureGetSubpixelOrder (pScreen);
se.sequenceNumber = client->sequence;
se.sizeID = RR10CurrentSizeID (pScreen); se.sizeID = RR10CurrentSizeID (pScreen);
if (se.rotation & (RR_Rotate_90 | RR_Rotate_270)) { if (se.rotation & (RR_Rotate_90 | RR_Rotate_270)) {

View File

@ -58,7 +58,6 @@ and Jim Haggerty of Metheus.
#include "protocol-versions.h" #include "protocol-versions.h"
static RESTYPE RTContext; /* internal resource type for Record contexts */ static RESTYPE RTContext; /* internal resource type for Record contexts */
static int RecordErrorBase; /* first Record error number */
/* How many bytes of protocol data to buffer in a context. Don't set to less /* How many bytes of protocol data to buffer in a context. Don't set to less
* than 32. * than 32.
@ -133,7 +132,7 @@ static int numEnabledRCAPs;
int rc = dixLookupResourceByType((pointer *)&(_pContext), _contextid, \ int rc = dixLookupResourceByType((pointer *)&(_pContext), _contextid, \
RTContext, _client, DixUseAccess); \ RTContext, _client, DixUseAccess); \
if (rc != Success) \ if (rc != Success) \
return (rc == BadValue) ? RecordErrorBase + XRecordBadContext : rc; \ return rc; \
} }
static int RecordDeleteContext( static int RecordDeleteContext(
@ -2911,7 +2910,7 @@ RecordExtensionInit(void)
DeleteCallback(&ClientStateCallback, RecordAClientStateChange, NULL); DeleteCallback(&ClientStateCallback, RecordAClientStateChange, NULL);
return; return;
} }
RecordErrorBase = extentry->errorBase; SetResourceTypeErrorValue(RTContext, extentry->errorBase + XRecordBadContext);
} /* RecordExtensionInit */ } /* RecordExtensionInit */

View File

@ -1115,7 +1115,6 @@ ChangePicture (PicturePtr pPicture,
if (error != Success) if (error != Success)
{ {
client->errorValue = pid; client->errorValue = pid;
error = (error == BadValue) ? RenderErrBase + BadPicture : error;
break; break;
} }
if (pAlpha->pDrawable == NULL || if (pAlpha->pDrawable == NULL ||
@ -1176,7 +1175,6 @@ ChangePicture (PicturePtr pPicture,
if (error != Success) if (error != Success)
{ {
client->errorValue = pid; client->errorValue = pid;
error = (error == BadValue) ? BadPixmap : error;
break; break;
} }
} }

View File

@ -412,7 +412,7 @@ extern _X_EXPORT RESTYPE GlyphSetType;
int rc = dixLookupResourceByType((pointer)&(pPicture), pid,\ int rc = dixLookupResourceByType((pointer)&(pPicture), pid,\
PictureType, client, mode);\ PictureType, client, mode);\
if (rc != Success)\ if (rc != Success)\
return (rc == BadValue) ? RenderErrBase + BadPicture : rc;\ return rc;\
} }
#define VERIFY_ALPHA(pPicture, pid, client, mode) {\ #define VERIFY_ALPHA(pPicture, pid, client, mode) {\

View File

@ -233,6 +233,10 @@ RenderClientCallback (CallbackListPtr *list,
pRenderClient->minor_version = 0; pRenderClient->minor_version = 0;
} }
#ifdef PANORAMIX
unsigned long XRT_PICTURE;
#endif
void void
RenderExtensionInit (void) RenderExtensionInit (void)
{ {
@ -253,6 +257,13 @@ RenderExtensionInit (void)
if (!extEntry) if (!extEntry)
return; return;
RenderErrBase = extEntry->errorBase; RenderErrBase = extEntry->errorBase;
#ifdef PANORAMIX
if (XRT_PICTURE)
SetResourceTypeErrorValue(XRT_PICTURE, RenderErrBase + BadPicture);
#endif
SetResourceTypeErrorValue(PictureType, RenderErrBase + BadPicture);
SetResourceTypeErrorValue(PictFormatType, RenderErrBase + BadPictFormat);
SetResourceTypeErrorValue(GlyphSetType, RenderErrBase + BadGlyphSet);
} }
static int static int
@ -532,7 +543,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->format, rc = dixLookupResourceByType((pointer *)&pFormat, stuff->format,
PictFormatType, client, DixReadAccess); PictFormatType, client, DixReadAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; return rc;
if (pFormat->type != PictTypeIndexed) if (pFormat->type != PictTypeIndexed)
{ {
@ -601,7 +612,7 @@ ProcRenderCreatePicture (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->format, rc = dixLookupResourceByType((pointer *)&pFormat, stuff->format,
PictFormatType, client, DixReadAccess); PictFormatType, client, DixReadAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; return rc;
if (pFormat->depth != pDrawable->depth) if (pFormat->depth != pDrawable->depth)
return BadMatch; return BadMatch;
@ -755,7 +766,7 @@ ProcRenderTrapezoids (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat, rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
PictFormatType, client, DixReadAccess); PictFormatType, client, DixReadAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; return rc;
} }
else else
pFormat = 0; pFormat = 0;
@ -795,7 +806,7 @@ ProcRenderTriangles (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat, rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
PictFormatType, client, DixReadAccess); PictFormatType, client, DixReadAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; return rc;
} }
else else
pFormat = 0; pFormat = 0;
@ -835,7 +846,7 @@ ProcRenderTriStrip (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat, rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
PictFormatType, client, DixReadAccess); PictFormatType, client, DixReadAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; return rc;
} }
else else
pFormat = 0; pFormat = 0;
@ -875,7 +886,7 @@ ProcRenderTriFan (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat, rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
PictFormatType, client, DixReadAccess); PictFormatType, client, DixReadAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; return rc;
} }
else else
pFormat = 0; pFormat = 0;
@ -922,7 +933,7 @@ ProcRenderCreateGlyphSet (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&format, stuff->format, rc = dixLookupResourceByType((pointer *)&format, stuff->format,
PictFormatType, client, DixReadAccess); PictFormatType, client, DixReadAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; return rc;
switch (format->depth) { switch (format->depth) {
case 1: case 1:
@ -974,7 +985,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client)
if (rc != Success) if (rc != Success)
{ {
client->errorValue = stuff->existing; client->errorValue = stuff->existing;
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc; return rc;
} }
glyphSet->refcnt++; glyphSet->refcnt++;
if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet))
@ -998,7 +1009,7 @@ ProcRenderFreeGlyphSet (ClientPtr client)
if (rc != Success) if (rc != Success)
{ {
client->errorValue = stuff->glyphset; client->errorValue = stuff->glyphset;
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc; return rc;
} }
FreeResource (stuff->glyphset, RT_NONE); FreeResource (stuff->glyphset, RT_NONE);
return Success; return Success;
@ -1037,7 +1048,7 @@ ProcRenderAddGlyphs (ClientPtr client)
if (err != Success) if (err != Success)
{ {
client->errorValue = stuff->glyphset; client->errorValue = stuff->glyphset;
return (err == BadValue) ? RenderErrBase + BadGlyphSet : err; return err;
} }
err = BadAlloc; err = BadAlloc;
@ -1238,7 +1249,7 @@ ProcRenderFreeGlyphs (ClientPtr client)
if (rc != Success) if (rc != Success)
{ {
client->errorValue = stuff->glyphset; client->errorValue = stuff->glyphset;
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc; return rc;
} }
nglyph = bytes_to_int32((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq)); nglyph = bytes_to_int32((client->req_len << 2) - sizeof (xRenderFreeGlyphsReq));
gids = (CARD32 *) (stuff + 1); gids = (CARD32 *) (stuff + 1);
@ -1300,7 +1311,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat, rc = dixLookupResourceByType((pointer *)&pFormat, stuff->maskFormat,
PictFormatType, client, DixReadAccess); PictFormatType, client, DixReadAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadPictFormat : rc; return rc;
} }
else else
pFormat = 0; pFormat = 0;
@ -1308,7 +1319,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->glyphset, rc = dixLookupResourceByType((pointer *)&glyphSet, stuff->glyphset,
GlyphSetType, client, DixUseAccess); GlyphSetType, client, DixUseAccess);
if (rc != Success) if (rc != Success)
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc; return rc;
buffer = (CARD8 *) (stuff + 1); buffer = (CARD8 *) (stuff + 1);
end = (CARD8 *) stuff + (client->req_len << 2); end = (CARD8 *) stuff + (client->req_len << 2);
@ -1371,7 +1382,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
free(glyphsBase); free(glyphsBase);
if (listsBase != listsLocal) if (listsBase != listsLocal)
free(listsBase); free(listsBase);
return (rc == BadValue) ? RenderErrBase + BadGlyphSet : rc; return rc;
} }
} }
buffer += 4; buffer += 4;
@ -1856,7 +1867,7 @@ ProcRenderCreateAnimCursor (ClientPtr client)
if (ret != Success) if (ret != Success)
{ {
free(cursors); free(cursors);
return (ret == BadValue) ? BadCursor : ret; return ret;
} }
deltas[i] = elt->delay; deltas[i] = elt->delay;
elt++; elt++;
@ -2639,7 +2650,7 @@ SProcRenderDispatch (ClientPtr client)
int rc = dixLookupResourceByType((pointer *)&(pPicture), pid,\ int rc = dixLookupResourceByType((pointer *)&(pPicture), pid,\
XRT_PICTURE, client, mode);\ XRT_PICTURE, client, mode);\
if (rc != Success)\ if (rc != Success)\
return (rc == BadValue) ? RenderErrBase + BadPicture : rc;\ return rc;\
} }
#define VERIFY_XIN_ALPHA(pPicture, pid, client, mode) {\ #define VERIFY_XIN_ALPHA(pPicture, pid, client, mode) {\
@ -2652,8 +2663,6 @@ SProcRenderDispatch (ClientPtr client)
int (*PanoramiXSaveRenderVector[RenderNumberRequests])(ClientPtr); int (*PanoramiXSaveRenderVector[RenderNumberRequests])(ClientPtr);
unsigned long XRT_PICTURE;
static int static int
PanoramiXRenderCreatePicture (ClientPtr client) PanoramiXRenderCreatePicture (ClientPtr client)
{ {
@ -3330,6 +3339,8 @@ PanoramiXRenderInit (void)
XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource, XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource,
"XineramaPicture"); "XineramaPicture");
if (RenderErrBase)
SetResourceTypeErrorValue(XRT_PICTURE, RenderErrBase + BadPicture);
for (i = 0; i < RenderNumberRequests; i++) for (i = 0; i < RenderNumberRequests; i++)
PanoramiXSaveRenderVector[i] = ProcRenderVector[i]; PanoramiXSaveRenderVector[i] = ProcRenderVector[i];
/* /*
@ -3365,6 +3376,7 @@ PanoramiXRenderReset (void)
int i; int i;
for (i = 0; i < RenderNumberRequests; i++) for (i = 0; i < RenderNumberRequests; i++)
ProcRenderVector[i] = PanoramiXSaveRenderVector[i]; ProcRenderVector[i] = PanoramiXSaveRenderVector[i];
RenderErrBase = 0;
} }
#endif /* PANORAMIX */ #endif /* PANORAMIX */

View File

@ -70,10 +70,7 @@ static void deleteCursorHideCountsForScreen (ScreenPtr pScreen);
int err; \ int err; \
err = dixLookupResourceByType((pointer *) &pCursor, cursor, \ err = dixLookupResourceByType((pointer *) &pCursor, cursor, \
RT_CURSOR, client, access); \ RT_CURSOR, client, access); \
if (err == BadValue) { \ if (err != Success) { \
client->errorValue = cursor; \
return BadCursor; \
} else if (err != Success) { \
client->errorValue = cursor; \ client->errorValue = cursor; \
return err; \ return err; \
} \ } \
@ -164,13 +161,11 @@ CursorDisplayCursor (DeviceIntPtr pDev,
CursorCurrent[pDev->id] = pCursor; CursorCurrent[pDev->id] = pCursor;
for (e = cursorEvents; e; e = e->next) for (e = cursorEvents; e; e = e->next)
{ {
if ((e->eventMask & XFixesDisplayCursorNotifyMask) && if ((e->eventMask & XFixesDisplayCursorNotifyMask))
!e->pClient->clientGone)
{ {
xXFixesCursorNotifyEvent ev; xXFixesCursorNotifyEvent ev;
ev.type = XFixesEventBase + XFixesCursorNotify; ev.type = XFixesEventBase + XFixesCursorNotify;
ev.subtype = XFixesDisplayCursorNotify; ev.subtype = XFixesDisplayCursorNotify;
ev.sequenceNumber = e->pClient->sequence;
ev.window = e->pWindow->drawable.id; ev.window = e->pWindow->drawable.id;
ev.cursorSerial = pCursor->serialNumber; ev.cursorSerial = pCursor->serialNumber;
ev.timestamp = currentTime.milliseconds; ev.timestamp = currentTime.milliseconds;
@ -884,7 +879,7 @@ ProcXFixesHideCursor (ClientPtr client)
client, DixGetAttrAccess); client, DixGetAttrAccess);
if (ret != Success) { if (ret != Success) {
client->errorValue = stuff->window; client->errorValue = stuff->window;
return (ret == BadValue) ? BadWindow : ret; return ret;
} }
/* /*
@ -947,7 +942,7 @@ ProcXFixesShowCursor (ClientPtr client)
client, DixGetAttrAccess); client, DixGetAttrAccess);
if (rc != Success) { if (rc != Success) {
client->errorValue = stuff->window; client->errorValue = stuff->window;
return (rc == BadValue) ? BadWindow : rc; return rc;
} }
/* /*

View File

@ -119,7 +119,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client)
if (rc != Success) if (rc != Success)
{ {
client->errorValue = stuff->bitmap; client->errorValue = stuff->bitmap;
return (rc == BadValue) ? BadPixmap : rc; return rc;
} }
if (pPixmap->drawable.depth != 1) if (pPixmap->drawable.depth != 1)
return BadMatch; return BadMatch;
@ -164,7 +164,7 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client)
if (rc != Success) if (rc != Success)
{ {
client->errorValue = stuff->window; client->errorValue = stuff->window;
return (rc == BadValue) ? BadWindow : rc; return rc;
} }
switch (stuff->kind) { switch (stuff->kind) {
case WindowRegionBounding: case WindowRegionBounding:
@ -675,7 +675,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
if (rc != Success) if (rc != Success)
{ {
client->errorValue = stuff->dest; client->errorValue = stuff->dest;
return (rc == BadValue) ? BadWindow : rc; return rc;
} }
VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixWriteAccess); VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixWriteAccess);
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;

View File

@ -78,15 +78,13 @@ XFixesSelectionCallback (CallbackListPtr *callbacks, pointer data, pointer args)
for (e = selectionEvents; e; e = e->next) for (e = selectionEvents; e; e = e->next)
{ {
if (e->selection == selection->selection && if (e->selection == selection->selection &&
(e->eventMask & eventMask) && (e->eventMask & eventMask))
!e->pClient->clientGone)
{ {
xXFixesSelectionNotifyEvent ev; xXFixesSelectionNotifyEvent ev;
memset(&ev, 0, sizeof(xXFixesSelectionNotifyEvent)); memset(&ev, 0, sizeof(xXFixesSelectionNotifyEvent));
ev.type = XFixesEventBase + XFixesSelectionNotify; ev.type = XFixesEventBase + XFixesSelectionNotify;
ev.subtype = subtype; ev.subtype = subtype;
ev.sequenceNumber = e->pClient->sequence;
ev.window = e->pWindow->drawable.id; ev.window = e->pWindow->drawable.id;
if (subtype == XFixesSetSelectionOwnerNotify) if (subtype == XFixesSetSelectionOwnerNotify)
ev.owner = selection->window; ev.owner = selection->window;

View File

@ -259,5 +259,6 @@ XFixesExtensionInit(void)
(EventSwapPtr) SXFixesSelectionNotifyEvent; (EventSwapPtr) SXFixesSelectionNotifyEvent;
EventSwapVector[XFixesEventBase + XFixesCursorNotify] = EventSwapVector[XFixesEventBase + XFixesCursorNotify] =
(EventSwapPtr) SXFixesCursorNotifyEvent; (EventSwapPtr) SXFixesCursorNotifyEvent;
SetResourceTypeErrorValue(RegionResType, XFixesErrorBase + BadRegion);
} }
} }

View File

@ -37,10 +37,7 @@ extern _X_EXPORT int XFixesErrorBase;
int err; \ int err; \
err = dixLookupResourceByType((pointer *) &pRegion, rid, \ err = dixLookupResourceByType((pointer *) &pRegion, rid, \
RegionResType, client, mode); \ RegionResType, client, mode); \
if (err == BadValue) { \ if (err != Success) { \
client->errorValue = rid; \
return XFixesErrorBase + BadRegion; \
} else if (err != Success) { \
client->errorValue = rid; \ client->errorValue = rid; \
return err; \ return err; \
} \ } \

View File

@ -102,7 +102,6 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed,
if (!XIShouldNotify(clients[i], kbd)) if (!XIShouldNotify(clients[i], kbd))
continue; continue;
core_mn.u.u.sequenceNumber = clients[i]->sequence;
if (keymap_changed) { if (keymap_changed) {
core_mn.u.mappingNotify.request = MappingKeyboard; core_mn.u.mappingNotify.request = MappingKeyboard;