Lines Matching full:client

131 #include "client.h"
162 static int nextFreeClientID; /* always MIN free client ID */
260 /* Client has requests queued or data on the network */
262 mark_client_ready(ClientPtr client) in mark_client_ready() argument
264 if (xorg_list_is_empty(&client->ready)) in mark_client_ready()
265 xorg_list_append(&client->ready, &ready_clients); in mark_client_ready()
269 * Client has requests queued or data on the network, but awaits a
272 void mark_client_saved_ready(ClientPtr client) in mark_client_saved_ready() argument
274 if (xorg_list_is_empty(&client->ready)) in mark_client_saved_ready()
275 xorg_list_append(&client->ready, &saved_ready_clients); in mark_client_saved_ready()
278 /* Client has no requests queued and no data on network */
280 mark_client_not_ready(ClientPtr client) in mark_client_not_ready() argument
282 xorg_list_del(&client->ready); in mark_client_not_ready()
288 ClientPtr client, tmp; in mark_client_grab() local
290 xorg_list_for_each_entry_safe(client, tmp, &ready_clients, ready) { in mark_client_grab()
291 if (client != grab) { in mark_client_grab()
292 xorg_list_del(&client->ready); in mark_client_grab()
293 xorg_list_append(&client->ready, &saved_ready_clients); in mark_client_grab()
301 ClientPtr client, tmp; in mark_client_ungrab() local
303 xorg_list_for_each_entry_safe(client, tmp, &saved_ready_clients, ready) { in mark_client_ungrab()
304 xorg_list_del(&client->ready); in mark_client_ungrab()
305 xorg_list_append(&client->ready, &ready_clients); in mark_client_ungrab()
330 /* check priority to select best client */ in SmartScheduleClient()
336 /* pick the best client */ in SmartScheduleClient()
359 * Set current client pointer in SmartScheduleClient()
370 * If it's been a long time since another client in SmartScheduleClient()
372 * performance from a single client in SmartScheduleClient()
406 ClientPtr client; in Dispatch() local
430 client = SmartScheduleClient(); in Dispatch()
443 if (client->smart_priority > SMART_MIN_PRIORITY) in Dispatch()
444 client->smart_priority--; in Dispatch()
448 /* now, finally, deal with client requests */ in Dispatch()
449 result = ReadRequestFromClient(client); in Dispatch()
452 CloseDownClient(client); in Dispatch()
456 client->sequence++; in Dispatch()
457 client->majorOp = ((xReq *) client->requestBuffer)->reqType; in Dispatch()
458 client->minorOp = 0; in Dispatch()
459 if (client->majorOp >= EXTENSION_BASE) { in Dispatch()
460 ExtensionEntry *ext = GetExtensionEntry(client->majorOp); in Dispatch()
463 client->minorOp = ext->MinorOpcode(client); in Dispatch()
467 XSERVER_REQUEST_START(LookupMajorName(client->majorOp), in Dispatch()
468 client->majorOp, in Dispatch()
469 ((xReq *) client->requestBuffer)->length, in Dispatch()
470 client->index, in Dispatch()
471 client->requestBuffer); in Dispatch()
476 result = XaceHookDispatch(client, client->majorOp); in Dispatch()
479 (*client->requestVector[client->majorOp]) (client); in Dispatch()
486 XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp), in Dispatch()
487 client->majorOp, client->sequence, in Dispatch()
488 client->index, result); in Dispatch()
491 if (client->noClientException != Success) { in Dispatch()
492 CloseDownClient(client); in Dispatch()
496 SendErrorToClient(client, client->majorOp, in Dispatch()
497 client->minorOp, in Dispatch()
498 client->errorValue, result); in Dispatch()
503 if (client == SmartLastClient) in Dispatch()
504 client->smart_stop_tick = SmartScheduleTime; in Dispatch()
665 ProcBadRequest(ClientPtr client) in ProcBadRequest() argument
671 ProcCreateWindow(ClientPtr client) in ProcCreateWindow() argument
680 LEGAL_NEW_RESOURCE(stuff->wid, client); in ProcCreateWindow()
681 rc = dixLookupWindow(&pParent, stuff->parent, client, DixAddAccess); in ProcCreateWindow()
684 len = client->req_len - bytes_to_int32(sizeof(xCreateWindowReq)); in ProcCreateWindow()
688 client->errorValue = 0; in ProcCreateWindow()
695 (int) stuff->depth, client, stuff->visual, &rc); in ProcCreateWindow()
708 ProcChangeWindowAttributes(ClientPtr client) in ProcChangeWindowAttributes() argument
719 rc = dixLookupWindow(&pWin, stuff->window, client, access_mode); in ProcChangeWindowAttributes()
722 len = client->req_len - bytes_to_int32(sizeof(xChangeWindowAttributesReq)); in ProcChangeWindowAttributes()
726 stuff->valueMask, (XID *) &stuff[1], client); in ProcChangeWindowAttributes()
730 ProcGetWindowAttributes(ClientPtr client) in ProcGetWindowAttributes() argument
739 rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess); in ProcGetWindowAttributes()
743 GetWindowAttributes(pWin, client, &wa); in ProcGetWindowAttributes()
744 WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa); in ProcGetWindowAttributes()
749 ProcDestroyWindow(ClientPtr client) in ProcDestroyWindow() argument
757 rc = dixLookupWindow(&pWin, stuff->id, client, DixDestroyAccess); in ProcDestroyWindow()
761 rc = dixLookupWindow(&pWin, pWin->parent->drawable.id, client, in ProcDestroyWindow()
771 ProcDestroySubwindows(ClientPtr client) in ProcDestroySubwindows() argument
779 rc = dixLookupWindow(&pWin, stuff->id, client, DixRemoveAccess); in ProcDestroySubwindows()
782 DestroySubwindows(pWin, client); in ProcDestroySubwindows()
787 ProcChangeSaveSet(ClientPtr client) in ProcChangeSaveSet() argument
795 rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess); in ProcChangeSaveSet()
798 if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) in ProcChangeSaveSet()
801 return AlterSaveSetForClient(client, pWin, stuff->mode, FALSE, TRUE); in ProcChangeSaveSet()
802 client->errorValue = stuff->mode; in ProcChangeSaveSet()
807 ProcReparentWindow(ClientPtr client) in ProcReparentWindow() argument
815 rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess); in ProcReparentWindow()
818 rc = dixLookupWindow(&pParent, stuff->parent, client, DixAddAccess); in ProcReparentWindow()
830 (short) stuff->x, (short) stuff->y, client); in ProcReparentWindow()
834 ProcMapWindow(ClientPtr client) in ProcMapWindow() argument
842 rc = dixLookupWindow(&pWin, stuff->id, client, DixShowAccess); in ProcMapWindow()
845 MapWindow(pWin, client); in ProcMapWindow()
851 ProcMapSubwindows(ClientPtr client) in ProcMapSubwindows() argument
859 rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess); in ProcMapSubwindows()
862 MapSubwindows(pWin, client); in ProcMapSubwindows()
868 ProcUnmapWindow(ClientPtr client) in ProcUnmapWindow() argument
876 rc = dixLookupWindow(&pWin, stuff->id, client, DixHideAccess); in ProcUnmapWindow()
885 ProcUnmapSubwindows(ClientPtr client) in ProcUnmapSubwindows() argument
893 rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess); in ProcUnmapSubwindows()
901 ProcConfigureWindow(ClientPtr client) in ProcConfigureWindow() argument
909 rc = dixLookupWindow(&pWin, stuff->window, client, in ProcConfigureWindow()
913 len = client->req_len - bytes_to_int32(sizeof(xConfigureWindowReq)); in ProcConfigureWindow()
916 return ConfigureWindow(pWin, (Mask) stuff->mask, (XID *) &stuff[1], client); in ProcConfigureWindow()
920 ProcCirculateWindow(ClientPtr client) in ProcCirculateWindow() argument
929 client->errorValue = stuff->direction; in ProcCirculateWindow()
932 rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess); in ProcCirculateWindow()
935 CirculateWindow(pWin, (int) stuff->direction, client); in ProcCirculateWindow()
940 GetGeometry(ClientPtr client, xGetGeometryReply * rep) in GetGeometry() argument
948 rc = dixLookupDrawable(&pDraw, stuff->id, client, M_ANY, DixGetAttrAccess); in GetGeometry()
954 rep->sequenceNumber = client->sequence; in GetGeometry()
976 ProcGetGeometry(ClientPtr client) in ProcGetGeometry() argument
981 if ((status = GetGeometry(client, &rep)) != Success) in ProcGetGeometry()
984 WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); in ProcGetGeometry()
989 ProcQueryTree(ClientPtr client) in ProcQueryTree() argument
999 rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess); in ProcQueryTree()
1005 .sequenceNumber = client->sequence, in ProcQueryTree()
1026 WriteReplyToClient(client, sizeof(xQueryTreeReply), &reply); in ProcQueryTree()
1028 client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; in ProcQueryTree()
1029 WriteSwappedDataToClient(client, numChildren * sizeof(Window), in ProcQueryTree()
1038 ProcInternAtom(ClientPtr client) in ProcInternAtom() argument
1047 client->errorValue = stuff->onlyIfExists; in ProcInternAtom()
1055 .sequenceNumber = client->sequence, in ProcInternAtom()
1059 WriteReplyToClient(client, sizeof(xInternAtomReply), &reply); in ProcInternAtom()
1067 ProcGetAtomName(ClientPtr client) in ProcGetAtomName() argument
1078 .sequenceNumber = client->sequence, in ProcGetAtomName()
1083 WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply); in ProcGetAtomName()
1084 WriteToClient(client, len, str); in ProcGetAtomName()
1088 client->errorValue = stuff->id; in ProcGetAtomName()
1094 ProcGrabServer(ClientPtr client) in ProcGrabServer() argument
1099 if (grabState != GrabNone && client != grabClient) { in ProcGrabServer()
1100 ResetCurrentRequest(client); in ProcGrabServer()
1101 client->sequence--; in ProcGrabServer()
1102 BITSET(grabWaiters, client->index); in ProcGrabServer()
1103 IgnoreClient(client); in ProcGrabServer()
1106 rc = OnlyListenToOneClient(client); in ProcGrabServer()
1110 grabClient = client; in ProcGrabServer()
1111 mark_client_grab(client); in ProcGrabServer()
1116 grabinfo.client = client; in ProcGrabServer()
1125 UngrabServer(ClientPtr client) in UngrabServer() argument
1144 grabinfo.client = client; in UngrabServer()
1151 ProcUngrabServer(ClientPtr client) in ProcUngrabServer() argument
1154 UngrabServer(client); in ProcUngrabServer()
1159 ProcTranslateCoords(ClientPtr client) in ProcTranslateCoords() argument
1168 rc = dixLookupWindow(&pWin, stuff->srcWid, client, DixGetAttrAccess); in ProcTranslateCoords()
1171 rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixGetAttrAccess); in ProcTranslateCoords()
1177 .sequenceNumber = client->sequence, in ProcTranslateCoords()
1226 WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep); in ProcTranslateCoords()
1231 ProcOpenFont(ClientPtr client) in ProcOpenFont() argument
1238 client->errorValue = stuff->fid; in ProcOpenFont()
1239 LEGAL_NEW_RESOURCE(stuff->fid, client); in ProcOpenFont()
1240 err = OpenFont(client, stuff->fid, (Mask) 0, in ProcOpenFont()
1250 ProcCloseFont(ClientPtr client) in ProcCloseFont() argument
1259 client, DixDestroyAccess); in ProcCloseFont()
1265 client->errorValue = stuff->id; in ProcCloseFont()
1271 ProcQueryFont(ClientPtr client) in ProcQueryFont() argument
1280 rc = dixLookupFontable(&pFont, stuff->id, client, DixGetAttrAccess); in ProcQueryFont()
1307 reply->sequenceNumber = client->sequence; in ProcQueryFont()
1310 WriteReplyToClient(client, rlength, reply); in ProcQueryFont()
1317 ProcQueryTextExtents(ClientPtr client) in ProcQueryTextExtents() argument
1328 rc = dixLookupFontable(&pFont, stuff->fid, client, DixGetAttrAccess); in ProcQueryTextExtents()
1332 length = client->req_len - bytes_to_int32(sizeof(xQueryTextExtentsReq)); in ProcQueryTextExtents()
1344 .sequenceNumber = client->sequence, in ProcQueryTextExtents()
1354 WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply); in ProcQueryTextExtents()
1359 ProcListFonts(ClientPtr client) in ProcListFonts() argument
1365 return ListFonts(client, (unsigned char *) &stuff[1], stuff->nbytes, in ProcListFonts()
1370 ProcListFontsWithInfo(ClientPtr client) in ProcListFontsWithInfo() argument
1376 return StartListFontsWithInfo(client, stuff->nbytes, in ProcListFontsWithInfo()
1393 ProcCreatePixmap(ClientPtr client) in ProcCreatePixmap() argument
1403 client->errorValue = stuff->pid; in ProcCreatePixmap()
1404 LEGAL_NEW_RESOURCE(stuff->pid, client); in ProcCreatePixmap()
1406 rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY, in ProcCreatePixmap()
1412 client->errorValue = 0; in ProcCreatePixmap()
1436 client->errorValue = stuff->depth; in ProcCreatePixmap()
1446 rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, RT_PIXMAP, in ProcCreatePixmap()
1459 ProcFreePixmap(ClientPtr client) in ProcFreePixmap() argument
1468 client, DixDestroyAccess); in ProcFreePixmap()
1474 client->errorValue = stuff->id; in ProcFreePixmap()
1480 ProcCreateGC(ClientPtr client) in ProcCreateGC() argument
1490 client->errorValue = stuff->gc; in ProcCreateGC()
1491 LEGAL_NEW_RESOURCE(stuff->gc, client); in ProcCreateGC()
1492 rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, in ProcCreateGC()
1497 len = client->req_len - bytes_to_int32(sizeof(xCreateGCReq)); in ProcCreateGC()
1501 stuff->gc, client); in ProcCreateGC()
1510 ProcChangeGC(ClientPtr client) in ProcChangeGC() argument
1519 result = dixLookupGC(&pGC, stuff->gc, client, DixSetAttrAccess); in ProcChangeGC()
1523 len = client->req_len - bytes_to_int32(sizeof(xChangeGCReq)); in ProcChangeGC()
1527 return ChangeGCXIDs(client, pGC, stuff->mask, (CARD32 *) &stuff[1]); in ProcChangeGC()
1531 ProcCopyGC(ClientPtr client) in ProcCopyGC() argument
1540 result = dixLookupGC(&pGC, stuff->srcGC, client, DixGetAttrAccess); in ProcCopyGC()
1543 result = dixLookupGC(&dstGC, stuff->dstGC, client, DixSetAttrAccess); in ProcCopyGC()
1549 client->errorValue = stuff->mask; in ProcCopyGC()
1556 ProcSetDashes(ClientPtr client) in ProcSetDashes() argument
1565 client->errorValue = 0; in ProcSetDashes()
1569 result = dixLookupGC(&pGC, stuff->gc, client, DixSetAttrAccess); in ProcSetDashes()
1575 client->errorValue = 0; in ProcSetDashes()
1581 ProcSetClipRectangles(ClientPtr client) in ProcSetClipRectangles() argument
1591 client->errorValue = stuff->ordering; in ProcSetClipRectangles()
1594 result = dixLookupGC(&pGC, stuff->gc, client, DixSetAttrAccess); in ProcSetClipRectangles()
1598 nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq); in ProcSetClipRectangles()
1607 ProcFreeGC(ClientPtr client) in ProcFreeGC() argument
1615 rc = dixLookupGC(&pGC, stuff->id, client, DixDestroyAccess); in ProcFreeGC()
1624 ProcClearToBackground(ClientPtr client) in ProcClearToBackground() argument
1631 rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess); in ProcClearToBackground()
1635 client->errorValue = stuff->window; in ProcClearToBackground()
1639 client->errorValue = stuff->exposures; in ProcClearToBackground()
1650 SendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable, in SendGraphicsExpose() argument
1679 TryClientEvents(client, NULL, pEvent, numRects, in SendGraphicsExpose()
1690 WriteEventsToClient(client, 1, &event); in SendGraphicsExpose()
1695 ProcCopyArea(ClientPtr client) in ProcCopyArea() argument
1709 rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0, in ProcCopyArea()
1714 client->errorValue = stuff->dstDrawable; in ProcCopyArea()
1725 SendGraphicsExpose(client, pRgn, stuff->dstDrawable, X_CopyArea, 0); in ProcCopyArea()
1734 ProcCopyPlane(ClientPtr client) in ProcCopyPlane() argument
1747 rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0, in ProcCopyPlane()
1753 client->errorValue = stuff->dstDrawable; in ProcCopyPlane()
1763 client->errorValue = stuff->bitPlane; in ProcCopyPlane()
1772 SendGraphicsExpose(client, pRgn, stuff->dstDrawable, X_CopyPlane, 0); in ProcCopyPlane()
1780 ProcPolyPoint(ClientPtr client) in ProcPolyPoint() argument
1791 client->errorValue = stuff->coordMode; in ProcPolyPoint()
1795 npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq)); in ProcPolyPoint()
1803 ProcPolyLine(ClientPtr client) in ProcPolyLine() argument
1814 client->errorValue = stuff->coordMode; in ProcPolyLine()
1818 npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq)); in ProcPolyLine()
1826 ProcPolySegment(ClientPtr client) in ProcPolySegment() argument
1836 nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq); in ProcPolySegment()
1846 ProcPolyRectangle(ClientPtr client) in ProcPolyRectangle() argument
1856 nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq); in ProcPolyRectangle()
1867 ProcPolyArc(ClientPtr client) in ProcPolyArc() argument
1877 narcs = (client->req_len << 2) - sizeof(xPolyArcReq); in ProcPolyArc()
1887 ProcFillPoly(ClientPtr client) in ProcFillPoly() argument
1898 client->errorValue = stuff->shape; in ProcFillPoly()
1903 client->errorValue = stuff->coordMode; in ProcFillPoly()
1908 things = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq)); in ProcFillPoly()
1917 ProcPolyFillRectangle(ClientPtr client) in ProcPolyFillRectangle() argument
1927 things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq); in ProcPolyFillRectangle()
1939 ProcPolyFillArc(ClientPtr client) in ProcPolyFillArc() argument
1949 narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq); in ProcPolyFillArc()
1970 #define ClientOrder(client) ((client)->swapped ? !ServerOrder() : ServerOrder()) argument
2013 ProcPutImage(ClientPtr client) in ProcPutImage() argument
2044 client->errorValue = stuff->format; in ProcPutImage()
2055 bytes_to_int32(sizeof(xPutImageReq))) != client->req_len) in ProcPutImage()
2060 ClientOrder(client)); in ProcPutImage()
2070 DoGetImage(ClientPtr client, int format, Drawable drawable, in DoGetImage() argument
2087 client->errorValue = format; in DoGetImage()
2090 rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixReadAccess); in DoGetImage()
2154 xgi.sequenceNumber = client->sequence; in DoGetImage()
2197 WriteReplyToClient(client, sizeof(xGetImageReply), &xgi); in DoGetImage()
2219 XaceCensorImage(client, pVisibleRegion, widthBytesLine, in DoGetImage()
2226 BitsPerPixel(pDraw->depth), ClientOrder(client)); in DoGetImage()
2228 WriteToClient(client, (int) (nlines * widthBytesLine), pBuf); in DoGetImage()
2246 XaceCensorImage(client, pVisibleRegion, in DoGetImage()
2254 1, ClientOrder(client)); in DoGetImage()
2256 WriteToClient(client, (int)(nlines * widthBytesLine), pBuf); in DoGetImage()
2267 ProcGetImage(ClientPtr client) in ProcGetImage() argument
2273 return DoGetImage(client, stuff->format, stuff->drawable, in ProcGetImage()
2280 ProcPolyText(ClientPtr client) in ProcPolyText() argument
2291 err = PolyText(client, in ProcPolyText()
2295 ((unsigned char *) stuff) + (client->req_len << 2), in ProcPolyText()
2306 ProcImageText8(ClientPtr client) in ProcImageText8() argument
2317 err = ImageText(client, in ProcImageText8()
2332 ProcImageText16(ClientPtr client) in ProcImageText16() argument
2343 err = ImageText(client, in ProcImageText16()
2358 ProcCreateColormap(ClientPtr client) in ProcCreateColormap() argument
2372 client->errorValue = stuff->alloc; in ProcCreateColormap()
2376 LEGAL_NEW_RESOURCE(mid, client); in ProcCreateColormap()
2377 result = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); in ProcCreateColormap()
2387 (int) stuff->alloc, client->index); in ProcCreateColormap()
2389 client->errorValue = stuff->visual; in ProcCreateColormap()
2394 ProcFreeColormap(ClientPtr client) in ProcFreeColormap() argument
2403 client, DixDestroyAccess); in ProcFreeColormap()
2411 client->errorValue = stuff->id; in ProcFreeColormap()
2417 ProcCopyColormapAndFree(ClientPtr client) in ProcCopyColormapAndFree() argument
2427 LEGAL_NEW_RESOURCE(mid, client); in ProcCopyColormapAndFree()
2429 RT_COLORMAP, client, in ProcCopyColormapAndFree()
2432 return CopyColormapAndFree(mid, pSrcMap, client->index); in ProcCopyColormapAndFree()
2433 client->errorValue = stuff->srcCmap; in ProcCopyColormapAndFree()
2438 ProcInstallColormap(ClientPtr client) in ProcInstallColormap() argument
2447 client, DixInstallAccess); in ProcInstallColormap()
2451 rc = XaceHook(XACE_SCREEN_ACCESS, client, pcmp->pScreen, DixSetAttrAccess); in ProcInstallColormap()
2462 client->errorValue = stuff->id; in ProcInstallColormap()
2467 ProcUninstallColormap(ClientPtr client) in ProcUninstallColormap() argument
2476 client, DixUninstallAccess); in ProcUninstallColormap()
2480 rc = XaceHook(XACE_SCREEN_ACCESS, client, pcmp->pScreen, DixSetAttrAccess); in ProcUninstallColormap()
2492 client->errorValue = stuff->id; in ProcUninstallColormap()
2497 ProcListInstalledColormaps(ClientPtr client) in ProcListInstalledColormaps() argument
2506 rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess); in ProcListInstalledColormaps()
2510 rc = XaceHook(XACE_SCREEN_ACCESS, client, pWin->drawable.pScreen, in ProcListInstalledColormaps()
2522 preply->sequenceNumber = client->sequence; in ProcListInstalledColormaps()
2527 WriteReplyToClient(client, sizeof(xListInstalledColormapsReply), preply); in ProcListInstalledColormaps()
2528 client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; in ProcListInstalledColormaps()
2529 WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]); in ProcListInstalledColormaps()
2535 ProcAllocColor(ClientPtr client) in ProcAllocColor() argument
2544 client, DixAddAccess); in ProcAllocColor()
2548 .sequenceNumber = client->sequence, in ProcAllocColor()
2556 &acr.pixel, client->index))) in ProcAllocColor()
2561 WriteReplyToClient(client, sizeof(xAllocColorReply), &acr); in ProcAllocColor()
2566 client->errorValue = stuff->cmap; in ProcAllocColor()
2572 ProcAllocNamedColor(ClientPtr client) in ProcAllocNamedColor() argument
2581 client, DixAddAccess); in ProcAllocNamedColor()
2585 .sequenceNumber = client->sequence, in ProcAllocNamedColor()
2597 &ancr.screenBlue, &ancr.pixel, client->index))) in ProcAllocNamedColor()
2602 WriteReplyToClient(client, sizeof(xAllocNamedColorReply), in ProcAllocNamedColor()
2611 client->errorValue = stuff->cmap; in ProcAllocNamedColor()
2617 ProcAllocColorCells(ClientPtr client) in ProcAllocColorCells() argument
2626 client, DixAddAccess); in ProcAllocColorCells()
2634 client->errorValue = npixels; in ProcAllocColorCells()
2638 client->errorValue = stuff->contiguous; in ProcAllocColorCells()
2648 if ((rc = AllocColorCells(client->index, pcmp, npixels, nmasks, in ProcAllocColorCells()
2659 .sequenceNumber = client->sequence, in ProcAllocColorCells()
2664 WriteReplyToClient(client, sizeof(xAllocColorCellsReply), &accr); in ProcAllocColorCells()
2665 client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; in ProcAllocColorCells()
2666 WriteSwappedDataToClient(client, length, ppixels); in ProcAllocColorCells()
2672 client->errorValue = stuff->cmap; in ProcAllocColorCells()
2678 ProcAllocColorPlanes(ClientPtr client) in ProcAllocColorPlanes() argument
2687 client, DixAddAccess); in ProcAllocColorPlanes()
2696 client->errorValue = npixels; in ProcAllocColorPlanes()
2700 client->errorValue = stuff->contiguous; in ProcAllocColorPlanes()
2705 .sequenceNumber = client->sequence, in ProcAllocColorPlanes()
2713 if ((rc = AllocColorPlanes(client->index, pcmp, npixels, in ProcAllocColorPlanes()
2726 WriteReplyToClient(client, sizeof(xAllocColorPlanesReply), &acpr); in ProcAllocColorPlanes()
2727 client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; in ProcAllocColorPlanes()
2728 WriteSwappedDataToClient(client, length, ppixels); in ProcAllocColorPlanes()
2734 client->errorValue = stuff->cmap; in ProcAllocColorPlanes()
2740 ProcFreeColors(ClientPtr client) in ProcFreeColors() argument
2749 client, DixRemoveAccess); in ProcFreeColors()
2755 count = bytes_to_int32((client->req_len << 2) - sizeof(xFreeColorsReq)); in ProcFreeColors()
2756 return FreeColors(pcmp, client->index, count, in ProcFreeColors()
2760 client->errorValue = stuff->cmap; in ProcFreeColors()
2766 ProcStoreColors(ClientPtr client) in ProcStoreColors() argument
2775 client, DixWriteAccess); in ProcStoreColors()
2779 count = (client->req_len << 2) - sizeof(xStoreColorsReq); in ProcStoreColors()
2783 return StoreColors(pcmp, count, (xColorItem *) &stuff[1], client); in ProcStoreColors()
2786 client->errorValue = stuff->cmap; in ProcStoreColors()
2792 ProcStoreNamedColor(ClientPtr client) in ProcStoreNamedColor() argument
2801 client, DixWriteAccess); in ProcStoreNamedColor()
2809 return StoreColors(pcmp, 1, &def, client); in ProcStoreNamedColor()
2814 client->errorValue = stuff->cmap; in ProcStoreNamedColor()
2820 ProcQueryColors(ClientPtr client) in ProcQueryColors() argument
2829 client, DixReadAccess); in ProcQueryColors()
2836 bytes_to_int32((client->req_len << 2) - sizeof(xQueryColorsReq)); in ProcQueryColors()
2841 QueryColors(pcmp, count, (Pixel *) &stuff[1], prgbs, client))) { in ProcQueryColors()
2847 .sequenceNumber = client->sequence, in ProcQueryColors()
2851 WriteReplyToClient(client, sizeof(xQueryColorsReply), &qcr); in ProcQueryColors()
2853 client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend; in ProcQueryColors()
2854 WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs); in ProcQueryColors()
2861 client->errorValue = stuff->cmap; in ProcQueryColors()
2867 ProcLookupColor(ClientPtr client) in ProcLookupColor() argument
2876 client, DixReadAccess); in ProcLookupColor()
2885 .sequenceNumber = client->sequence, in ProcLookupColor()
2897 WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr); in ProcLookupColor()
2903 client->errorValue = stuff->cmap; in ProcLookupColor()
2909 ProcCreateCursor(ClientPtr client) in ProcCreateCursor() argument
2924 LEGAL_NEW_RESOURCE(stuff->cid, client); in ProcCreateCursor()
2927 client, DixReadAccess); in ProcCreateCursor()
2929 client->errorValue = stuff->source; in ProcCreateCursor()
2939 client, DixReadAccess); in ProcCreateCursor()
2941 client->errorValue = stuff->mask; in ProcCreateCursor()
2991 &pCursor, client, stuff->cid); in ProcCreateCursor()
3008 ProcCreateGlyphCursor(ClientPtr client) in ProcCreateGlyphCursor() argument
3016 LEGAL_NEW_RESOURCE(stuff->cid, client); in ProcCreateGlyphCursor()
3022 &pCursor, client, stuff->cid); in ProcCreateGlyphCursor()
3031 ProcFreeCursor(ClientPtr client) in ProcFreeCursor() argument
3040 client, DixDestroyAccess); in ProcFreeCursor()
3046 client->errorValue = stuff->id; in ProcFreeCursor()
3052 ProcQueryBestSize(ClientPtr client) in ProcQueryBestSize() argument
3064 client->errorValue = stuff->class; in ProcQueryBestSize()
3068 rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY, in ProcQueryBestSize()
3075 rc = XaceHook(XACE_SCREEN_ACCESS, client, pScreen, DixGetAttrAccess); in ProcQueryBestSize()
3082 .sequenceNumber = client->sequence, in ProcQueryBestSize()
3087 WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply); in ProcQueryBestSize()
3092 ProcSetScreenSaver(ClientPtr client) in ProcSetScreenSaver() argument
3100 rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, screenInfo.screens[i], in ProcSetScreenSaver()
3110 client->errorValue = blankingOption; in ProcSetScreenSaver()
3117 client->errorValue = exposureOption; in ProcSetScreenSaver()
3121 client->errorValue = stuff->timeout; in ProcSetScreenSaver()
3125 client->errorValue = stuff->interval; in ProcSetScreenSaver()
3152 ProcGetScreenSaver(ClientPtr client) in ProcGetScreenSaver() argument
3160 rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, screenInfo.screens[i], in ProcGetScreenSaver()
3168 .sequenceNumber = client->sequence, in ProcGetScreenSaver()
3175 WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep); in ProcGetScreenSaver()
3180 ProcChangeHosts(ClientPtr client) in ProcChangeHosts() argument
3187 return AddHost(client, (int) stuff->hostFamily, in ProcChangeHosts()
3190 return RemoveHost(client, (int) stuff->hostFamily, in ProcChangeHosts()
3192 client->errorValue = stuff->mode; in ProcChangeHosts()
3197 ProcListHosts(ClientPtr client) in ProcListHosts() argument
3209 result = XaceHook(XACE_SERVER_ACCESS, client, DixReadAccess); in ProcListHosts()
3220 .sequenceNumber = client->sequence, in ProcListHosts()
3224 WriteReplyToClient(client, sizeof(xListHostsReply), &reply); in ProcListHosts()
3226 client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend; in ProcListHosts()
3227 WriteSwappedDataToClient(client, len, pdata); in ProcListHosts()
3234 ProcChangeAccessControl(ClientPtr client) in ProcChangeAccessControl() argument
3240 client->errorValue = stuff->mode; in ProcChangeAccessControl()
3243 return ChangeAccessControl(client, stuff->mode == EnableAccess); in ProcChangeAccessControl()
3257 ClientPtr client; in CloseDownRetainedResources() local
3260 client = clients[i]; in CloseDownRetainedResources()
3261 if (client && (client->closeDownMode == RetainTemporary) in CloseDownRetainedResources()
3262 && (client->clientGone)) in CloseDownRetainedResources()
3263 CloseDownClient(client); in CloseDownRetainedResources()
3268 ProcKillClient(ClientPtr client) in ProcKillClient() argument
3280 rc = dixLookupClient(&killclient, stuff->id, client, DixDestroyAccess); in ProcKillClient()
3283 if (client == killclient) { in ProcKillClient()
3285 * doesn't try to touch client in ProcKillClient()
3296 ProcSetFontPath(ClientPtr client) in ProcSetFontPath() argument
3307 nbytes = (client->req_len << 2) - sizeof(xSetFontPathReq); in ProcSetFontPath()
3319 return SetFontPath(client, stuff->nFonts, (unsigned char *) &stuff[1]); in ProcSetFontPath()
3323 ProcGetFontPath(ClientPtr client) in ProcGetFontPath() argument
3332 rc = GetFontPath(client, &numpaths, &stringLens, &bufferStart); in ProcGetFontPath()
3338 .sequenceNumber = client->sequence, in ProcGetFontPath()
3343 WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply); in ProcGetFontPath()
3345 WriteToClient(client, stringLens + numpaths, bufferStart); in ProcGetFontPath()
3350 ProcChangeCloseDownMode(ClientPtr client) in ProcChangeCloseDownMode() argument
3357 rc = XaceHook(XACE_CLIENT_ACCESS, client, client, DixManageAccess); in ProcChangeCloseDownMode()
3363 client->closeDownMode = stuff->mode; in ProcChangeCloseDownMode()
3367 client->errorValue = stuff->mode; in ProcChangeCloseDownMode()
3373 ProcForceScreenSaver(ClientPtr client) in ProcForceScreenSaver() argument
3382 client->errorValue = stuff->mode; in ProcForceScreenSaver()
3385 rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, (int) stuff->mode); in ProcForceScreenSaver()
3392 ProcNoOperation(ClientPtr client) in ProcNoOperation() argument
3403 * Client can either mark his resources destroy or retain. If retained and
3404 * then killed again, the client is really destroyed.
3410 CloseDownClient(ClientPtr client) in CloseDownClient() argument
3412 Bool really_close_down = client->clientGone || in CloseDownClient()
3413 client->closeDownMode == DestroyAll; in CloseDownClient()
3415 if (!client->clientGone) { in CloseDownClient()
3416 /* ungrab server if grabbing client dies */ in CloseDownClient()
3417 if (grabState != GrabNone && grabClient == client) { in CloseDownClient()
3418 UngrabServer(client); in CloseDownClient()
3420 BITCLEAR(grabWaiters, client->index); in CloseDownClient()
3421 DeleteClientFromAnySelections(client); in CloseDownClient()
3422 ReleaseActiveGrabs(client); in CloseDownClient()
3423 DeleteClientFontStuff(client); in CloseDownClient()
3428 * better not to traverse all the client's resources in CloseDownClient()
3433 FreeClientNeverRetainResources(client); in CloseDownClient()
3434 client->clientState = ClientStateRetained; in CloseDownClient()
3438 clientinfo.client = client; in CloseDownClient()
3444 client->clientGone = TRUE; /* so events aren't sent to client */ in CloseDownClient()
3445 if (ClientIsAsleep(client)) in CloseDownClient()
3446 ClientSignal(client); in CloseDownClient()
3448 CloseDownConnection(client); in CloseDownClient()
3449 output_pending_clear(client); in CloseDownClient()
3450 mark_client_not_ready(client); in CloseDownClient()
3452 /* If the client made it to the Running stage, nClients has in CloseDownClient()
3457 if (client->clientState != ClientStateInitial) { in CloseDownClient()
3463 if (client->clientState == ClientStateRunning && nClients == 0) in CloseDownClient()
3466 client->clientState = ClientStateGone; in CloseDownClient()
3470 clientinfo.client = client; in CloseDownClient()
3475 TouchListenerGone(client->clientAsMask); in CloseDownClient()
3476 FreeClientResources(client); in CloseDownClient()
3477 /* Disable client ID tracking. This must be done after in CloseDownClient()
3479 ReleaseClientIds(client); in CloseDownClient()
3481 XSERVER_CLIENT_DISCONNECT(client->index); in CloseDownClient()
3483 if (client->index < nextFreeClientID) in CloseDownClient()
3484 nextFreeClientID = client->index; in CloseDownClient()
3485 clients[client->index] = NullClient; in CloseDownClient()
3487 dixFreeObjectWithPrivates(client, PRIVATE_CLIENT); in CloseDownClient()
3508 InitClient(ClientPtr client, int i, void *ospriv) in InitClient() argument
3510 client->index = i; in InitClient()
3511 xorg_list_init(&client->ready); in InitClient()
3512 xorg_list_init(&client->output_pending); in InitClient()
3513 client->clientAsMask = ((Mask) i) << CLIENTOFFSET; in InitClient()
3514 client->closeDownMode = i ? DestroyAll : RetainPermanent; in InitClient()
3515 client->requestVector = InitialVector; in InitClient()
3516 client->osPrivate = ospriv; in InitClient()
3517 QueryMinMaxKeyCodes(&client->minKC, &client->maxKC); in InitClient()
3518 client->smart_start_tick = SmartScheduleTime; in InitClient()
3519 client->smart_stop_tick = SmartScheduleTime; in InitClient()
3520 client->clientIds = NULL; in InitClient()
3526 * OS dependent portion can't assign client id's because of CloseDownModes.
3534 ClientPtr client; in NextAvailableClient() local
3540 clients[i] = client = in NextAvailableClient()
3542 if (!client) in NextAvailableClient()
3544 InitClient(client, i, ospriv); in NextAvailableClient()
3545 if (!InitClientResources(client)) { in NextAvailableClient()
3546 dixFreeObjectWithPrivates(client, PRIVATE_CLIENT); in NextAvailableClient()
3551 if (!InsertFakeRequest(client, (char *) &data, sz_xReq)) { in NextAvailableClient()
3552 FreeClientResources(client); in NextAvailableClient()
3553 dixFreeObjectWithPrivates(client, PRIVATE_CLIENT); in NextAvailableClient()
3561 /* Enable client ID tracking. This must be done before in NextAvailableClient()
3563 ReserveClientIds(client); in NextAvailableClient()
3568 clientinfo.client = client; in NextAvailableClient()
3573 return client; in NextAvailableClient()
3577 ProcInitialConnection(ClientPtr client) in ProcInitialConnection() argument
3587 return client->noClientException = -1; in ProcInitialConnection()
3590 client->swapped = TRUE; in ProcInitialConnection()
3596 if (client->swapped) { in ProcInitialConnection()
3600 client->local = FALSE; in ProcInitialConnection()
3602 ResetCurrentRequest(client); in ProcInitialConnection()
3607 SendConnSetup(ClientPtr client, const char *reason) in SendConnSetup() argument
3623 if (client->swapped) in SendConnSetup()
3624 WriteSConnSetupPrefix(client, &csp); in SendConnSetup()
3626 WriteToClient(client, sz_xConnSetupPrefix, &csp); in SendConnSetup()
3627 WriteToClient(client, (int) csp.lengthReason, reason); in SendConnSetup()
3628 return client->noClientException = -1; in SendConnSetup()
3635 /* We're about to start speaking X protocol back to the client by in SendConnSetup()
3637 * step is complete, and we can count the client as an in SendConnSetup()
3642 client->requestVector = client->swapped ? SwappedProcVector : ProcVector; in SendConnSetup()
3643 client->sequence = 0; in SendConnSetup()
3644 ((xConnSetup *) lConnectionInfo)->ridBase = client->clientAsMask; in SendConnSetup()
3647 ((xConnSetup *) lConnectionInfo)->imageByteOrder = ClientOrder(client); in SendConnSetup()
3648 ((xConnSetup *) lConnectionInfo)->bitmapBitOrder = ClientOrder(client); in SendConnSetup()
3673 if (client->swapped) { in SendConnSetup()
3674 WriteSConnSetupPrefix(client, lconnSetupPrefix); in SendConnSetup()
3675 WriteSConnectionInfo(client, in SendConnSetup()
3680 WriteToClient(client, sizeof(xConnSetupPrefix), lconnSetupPrefix); in SendConnSetup()
3681 WriteToClient(client, (int) (lconnSetupPrefix->length << 2), in SendConnSetup()
3684 client->clientState = ClientStateRunning; in SendConnSetup()
3688 clientinfo.client = client; in SendConnSetup()
3697 ProcEstablishConnection(ClientPtr client) in ProcEstablishConnection() argument
3709 if ((client->req_len << 2) != sz_xReq + sz_xConnClientPrefix + in ProcEstablishConnection()
3717 reason = ClientAuthorized(client, in ProcEstablishConnection()
3723 return (SendConnSetup(client, reason)); in ProcEstablishConnection()
3727 SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode, in SendErrorToClient() argument
3738 WriteEventsToClient(client, 1, (xEvent *) &rep); in SendErrorToClient()
3742 MarkClientException(ClientPtr client) in MarkClientException() argument
3744 client->noClientException = -1; in MarkClientException()