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
This commit is contained in:
rkrolib 2003-10-08 20:17:10 +00:00
parent 65f88a4dc4
commit 30d1e165a0

View File

@ -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