From 30d1e165a0056e744d9a198184d46d02cc94e853 Mon Sep 17 00:00:00 2001 From: rkrolib Date: Wed, 8 Oct 2003 20:17:10 +0000 Subject: [PATCH] Changed CreateNotify (in X11 ONLY) to act like a ConfigureNotify event. This is done so that subwindows on X11 will get "resize" events when they are created. Old GLUT did this---presumably by design in order to ensure that (a) All windows get notified of their size as soon as the window exists, and (b) probably more importantly, so that windows and sub-windows behave as much alike as possible. I believe that GLUT was right to do this, and I believe that compatibility requires this (I have a sample program that breaks in freeglut but not GLUT without this fix). I did not touch the Microsoft side, because I don't know what their OS does---nor if old GLUT was historically system-dependant about this. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@217 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/freeglut_main.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/freeglut/freeglut/src/freeglut_main.c b/freeglut/freeglut/src/freeglut_main.c index cc2aca0..c28658f 100644 --- a/freeglut/freeglut/src/freeglut_main.c +++ b/freeglut/freeglut/src/freeglut_main.c @@ -568,12 +568,6 @@ void FGAPIENTRY glutMainLoopEvent( void ) */ switch( event.type ) { - case CreateNotify: - /* - * The window creation confirmation - */ - break; - case DestroyNotify: /* * This is sent to confirm the XDestroyWindow call. @@ -619,6 +613,19 @@ void FGAPIENTRY glutMainLoopEvent( void ) fghRedrawWindowByHandle( event.xexpose.window ); break; + /* + * CreateNotify causes a configure-event so that sub-windows are + * handled compatibly with GLUT. + * + * NOTE that it is possible that you will more than one Reshape + * event for your top-level window, but something like this appears + * to be required for compatbility. + * + * GLUT presumably does this because it generally tries to treat + * sub-windows the same as windows. + * + */ + case CreateNotify: case ConfigureNotify: /* * The window gets resized