From: Alan Hourihane Date: Thu, 16 Jan 2003 19:10:46 +0000 (+0000) Subject: fix for framebuffer width and height when window hasn't been realized. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5e9dd0407719be20b119259a3f4aeae1a0a1c8c1;p=mesa.git fix for framebuffer width and height when window hasn't been realized. --- diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index c0a71ff4b1e..0d29481e321 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.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;