コード例 #1
0
ファイル: glxext.c プロジェクト: sheldonrobinson/VcXsrv
static void
glxClientCallback(CallbackListPtr *list, pointer closure, pointer data)
{
    NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
    ClientPtr pClient = clientinfo->client;
    __GLXclientState *cl = glxGetClient(pClient);

    switch (pClient->clientState) {
    case ClientStateRunning:
        /*
         ** By default, assume that the client supports
         ** GLX major version 1 minor version 0 protocol.
         */
        cl->client = pClient;
        break;

    case ClientStateGone:
        free(cl->returnBuf);
        free(cl->largeCmdBuf);
        free(cl->GLClientextensions);
        break;

    default:
        break;
    }
}
コード例 #2
0
ファイル: glxext.c プロジェクト: osch/cygwin-xserver
static void
glxClientCallback(CallbackListPtr *list, pointer closure, pointer data)
{
    NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
    ClientPtr pClient = clientinfo->client;
    __GLXclientState *cl = glxGetClient(pClient);
    __GLXcontext *c, *next;

    switch (pClient->clientState) {
    case ClientStateRunning:
        cl->client = pClient;
        break;

    case ClientStateGone:
        /* detach from all current contexts */
        for (c = glxAllContexts; c; c = next) {
            next = c->next;
            if (c->currentClient == pClient) {
                c->loseCurrent(c);
                c->currentClient = NULL;
                FreeResourceByType(c, __glXContextRes, FALSE);
            }
        }

        free(cl->returnBuf);
        free(cl->largeCmdBuf);
        free(cl->GLClientextensions);
        break;

    default:
        break;
    }
}
コード例 #3
0
ファイル: glxext.c プロジェクト: 4eremuxa/xserver
void glxSuspendClients(void)
{
    int i;

    for (i = 1; i < currentMaxClients; i++) {
	if (clients[i] && glxGetClient(clients[i])->inUse)
	    IgnoreClient(clients[i]);
    }

    glxBlockClients = TRUE;
}
コード例 #4
0
ファイル: glxext.c プロジェクト: sheldonrobinson/VcXsrv
/*
** Top level dispatcher; all commands are executed from here down.
*/
static int
__glXDispatch(ClientPtr client)
{
    REQUEST(xGLXSingleReq);
    CARD8 opcode;
    __GLXdispatchSingleProcPtr proc;
    __GLXclientState *cl;
    int retval;

    opcode = stuff->glxCode;
    cl = glxGetClient(client);
    /* Mark it in use so we suspend it on VT switch. */
    cl->inUse = TRUE;

    /*
     ** If we're expecting a glXRenderLarge request, this better be one.
     */
    if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) {
        client->errorValue = stuff->glxCode;
        return __glXError(GLXBadLargeRequest);
    }

    /* If we're currently blocking GLX clients, just put this guy to
     * sleep, reset the request and return. */
    if (glxBlockClients) {
        ResetCurrentRequest(client);
        client->sequence--;
        IgnoreClient(client);
        return Success;
    }

    /*
     ** Use the opcode to index into the procedure table.
     */
    proc = __glXGetProtocolDecodeFunction(&Single_dispatch_info, opcode,
                                          client->swapped);
    if (proc != NULL) {
        GLboolean rendering = opcode <= X_GLXRenderLarge;

        __glXleaveServer(rendering);

        retval = (*proc) (cl, (GLbyte *) stuff);

        __glXenterServer(rendering);
    }
    else {
        retval = BadRequest;
    }

    return retval;
}
コード例 #5
0
ファイル: glxext.c プロジェクト: 4eremuxa/xserver
void glxResumeClients(void)
{
    __GLXcontext *cx, *next;
    int i;

    glxBlockClients = FALSE;

    for (i = 1; i < currentMaxClients; i++) {
	if (clients[i] && glxGetClient(clients[i])->inUse)
	    AttendClient(clients[i]);
    }

    __glXleaveServer(GL_FALSE);
    for (cx = glxPendingDestroyContexts; cx != NULL; cx = next) {
	next = cx->next;

	cx->destroy(cx);
    }
    glxPendingDestroyContexts = NULL;
    __glXenterServer(GL_FALSE);
}