fix for framebuffer width and height when window hasn't been realized.
authorAlan Hourihane <alanh@tungstengraphics.com>
Thu, 16 Jan 2003 19:10:46 +0000 (19:10 +0000)
committerAlan Hourihane <alanh@tungstengraphics.com>
Thu, 16 Jan 2003 19:10:46 +0000 (19:10 +0000)
src/mesa/drivers/x11/xm_dd.c

index c0a71ff4b1e27195b8ee7947d1963354355e70b5..0d29481e321dd54d3c7f37ac13d4aa2144232040 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: xm_dd.c,v 1.41 2002/10/30 20:24:47 brianp Exp $ */
+/* $Id: xm_dd.c,v 1.42 2003/01/16 19:10:46 alanh Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -64,8 +64,14 @@ get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
    unsigned int winwidth, winheight;
 #ifdef XFree86Server
    /* XFree86 GLX renderer */
-   winwidth = xmBuffer->frontbuffer->width;
-   winheight = xmBuffer->frontbuffer->height;
+   if (xmBuffer->frontbuffer->width > MAX_WIDTH ||
+       xmBuffer->frontbuffer->height > MAX_HEIGHT) {
+     winwidth = buffer->Width;
+     winheight = buffer->Height;
+   } else {
+     winwidth = xmBuffer->frontbuffer->width;
+     winheight = xmBuffer->frontbuffer->height;
+   }
 #else
    Window root;
    int winx, winy;