summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2003-01-16 19:12:16 +0000
committerAlan Hourihane <alanh@tungstengraphics.com>2003-01-16 19:12:16 +0000
commit35a1395bb4436a8cf5dd1807613a1006ea165dbf (patch)
tree0056d57f40bf09ca84c83c63fe5256e1f6db70e7
parentd495a2af43a4a107aff0ff2862423af8da577a33 (diff)
fix framebuffer width and height when windows hasn't been realized
-rw-r--r--src/mesa/drivers/x11/xm_dd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index ad6bd2db26..5e87a35695 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -1,4 +1,4 @@
-/* $Id: xm_dd.c,v 1.26.2.8 2002/09/23 17:20:12 brianp Exp $ */
+/* $Id: xm_dd.c,v 1.26.2.9 2003/01/16 19:12:16 alanh Exp $ */
/*
* Mesa 3-D graphics library
@@ -63,8 +63,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;