From 49d5acfd00fc579e020a3d21f3613185daa63f9e Mon Sep 17 00:00:00 2001 From: spanne Date: Thu, 30 Jun 2005 12:39:14 +0000 Subject: [PATCH] Cleaned up CreateNotify/ConfigureNotify handling. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@648 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/ChangeLog | 2 ++ freeglut/freeglut/src/freeglut_main.c | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/freeglut/freeglut/ChangeLog b/freeglut/freeglut/ChangeLog index 5ec8bbb..937980c 100644 --- a/freeglut/freeglut/ChangeLog +++ b/freeglut/freeglut/ChangeLog @@ -1062,3 +1062,5 @@ to crash if it called the code with a negative number of levels (274) Added --enable-debug configure flag. Currently it only turns on X11 event tracing, but in the future we could add more. + +(275) Cleaned up CreateNotify/ConfigureNotify handling. diff --git a/freeglut/freeglut/src/freeglut_main.c b/freeglut/freeglut/src/freeglut_main.c index d9172c7..febd4bc 100644 --- a/freeglut/freeglut/src/freeglut_main.c +++ b/freeglut/freeglut/src/freeglut_main.c @@ -1017,20 +1017,20 @@ void FGAPIENTRY glutMainLoopEvent( void ) * * GLUT presumably does this because it generally tries to treat * sub-windows the same as windows. - * - * XXX Technically, GETWINDOW( xconfigure ) and - * XXX {event.xconfigure} may not be legit ways to get at - * XXX data for CreateNotify events. In practice, the data - * XXX is in a union which is laid out much the same either - * XXX way. But if you want to split hairs, this isn't legit, - * XXX and we should instead duplicate some code. */ case CreateNotify: case ConfigureNotify: - GETWINDOW( xconfigure ); { - int width = event.xconfigure.width; - int height = event.xconfigure.height; + int width, height; + if( event.type == CreateNotify ) { + GETWINDOW( xcreatewindow ); + width = event.xcreatewindow.width; + height = event.xcreatewindow.height; + } else { + GETWINDOW( xconfigure ); + width = event.xconfigure.width; + height = event.xconfigure.height; + } if( ( width != window->State.OldWidth ) || ( height != window->State.OldHeight ) )