apple: ifdef out come glapi-foo on darwin
[mesa.git] / src / glx / indirect_glx.c
index f0598409cd6c83a91774a7c47b3aab05cfff26c1..b4f16c72536e4d16934039b789f10c856dc364c9 100644 (file)
@@ -137,10 +137,12 @@ indirect_bind_context(struct glx_context *gc, struct glx_context *old,
    Display *dpy = gc->psc->dpy;
    int opcode = __glXSetupForCommand(dpy);
 
-   if (old != &dummyContext && !old->isDirect && old->psc->dpy == dpy)
+   if (old != &dummyContext && !old->isDirect && old->psc->dpy == dpy) {
       tag = old->currentContextTag;
-   else
-      tag = None;
+      old->currentContextTag = 0;
+   } else {
+      tag = 0;
+   }
 
    SendMakeCurrentRequest(dpy, opcode, gc->xid, tag, draw, read, &reply);
 
@@ -166,14 +168,18 @@ indirect_unbind_context(struct glx_context *gc, struct glx_context *new)
    int opcode = __glXSetupForCommand(dpy);
    xGLXMakeCurrentReply reply;
 
+   if (gc == new)
+      return;
+   
    /* We are either switching to no context, away from a indirect
     * context to a direct context or from one dpy to another and have
     * to send a request to the dpy to unbind the previous context.
     */
-   if (!new || new->isDirect || new->psc->dpy != dpy)
+   if (!new || new->isDirect || new->psc->dpy != dpy) {
       SendMakeCurrentRequest(dpy, opcode, None,
                             gc->currentContextTag, None, None, &reply);
-   gc->currentContextTag = 0;
+      gc->currentContextTag = 0;
+   }
 }
 
 static void
@@ -398,10 +404,7 @@ indirect_create_context(struct glx_screen *psc,
 
    /*
     ** PERFORMANCE NOTE: A mode dependent fill image can speed things up.
-    ** Other code uses the fastImageUnpack bit, but it is never set
-    ** to GL_TRUE.
     */
-   gc->fastImageUnpack = GL_FALSE;
    gc->fillImage = __glFillImage;
    gc->pc = gc->buf;
    gc->bufEnd = gc->buf + bufSize;