glx: Demand success from CreateContext requests (v2)
[mesa.git] / src / glx / xfont.c
index 00756d18a05f03cac5a6568a535b0da412c4e4f2..00498bc3ea4e7833cd8e46367cfcb33cde275e73 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  3.1
  *
  * Copyright (C) 1999  Brian Paul   All Rights Reserved.
  *
@@ -223,6 +222,10 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis
    unsigned long valuemask;
    XFontStruct *fs;
 
+#if !defined(GLX_USE_APPLEGL)
+   __GLXDRIdrawable *glxdraw;
+#endif
+
    GLint swapbytes, lsbfirst, rowlength;
    GLint skiprows, skippixels, alignment;
 
@@ -234,6 +237,12 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis
    dpy = CC->currentDpy;
    win = CC->currentDrawable;
 
+#if !defined(GLX_USE_APPLEGL)
+   glxdraw = GetGLXDRIDrawable(CC->currentDpy, CC->currentDrawable);
+   if (glxdraw)
+      win = glxdraw->xDrawable;
+#endif
+
    fs = XQueryFont(dpy, font);
    if (!fs) {
       __glXSetError(CC, GL_INVALID_VALUE);