From 60cc2c79ce79ef502bbf6671b4d307da05ea8776 Mon Sep 17 00:00:00 2001 From: rkrolib Date: Tue, 2 Dec 2003 21:30:02 +0000 Subject: [PATCH] Changed Create/ConfigureNotify handling in UNIX_X11: * Just need to call GETWINDOW() once. Ooops. Heh. * Update {window->State} with the new size of the window. * If the window-size has NOT changed, then do NOT call the Reshape event. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@377 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/freeglut_main.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/freeglut/freeglut/src/freeglut_main.c b/freeglut/freeglut/src/freeglut_main.c index 144453d..d875e6a 100644 --- a/freeglut/freeglut/src/freeglut_main.c +++ b/freeglut/freeglut/src/freeglut_main.c @@ -573,13 +573,19 @@ void FGAPIENTRY glutMainLoopEvent( void ) int width = event.xconfigure.width; int height = event.xconfigure.height; - GETWINDOW( xconfigure ); - if( FETCH_WCB( *window, Reshape ) ) - INVOKE_WCB( *window, Reshape, ( width, height ) ); - else + if( ( width != window->State.Width ) || + ( height != window->State.Height ) ) { - fgSetWindow( window ); - glViewport( 0, 0, width, height ); + window->State.Width = width; + window->State.Height = height; + if( FETCH_WCB( *window, Reshape ) ) + INVOKE_WCB( *window, Reshape, ( width, height ) ); + else + { + fgSetWindow( window ); + glViewport( 0, 0, width, height ); + } + glutPostRedisplay( ); } } break;