+ * CreateNotify causes a configure-event so that sub-windows are
+ * handled compatibly with GLUT. Otherwise, your sub-windows
+ * (in freeglut only) will not get an initial reshape event,
+ * which can break things.
+ *
+ * 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;
+
+ if( ( width != window->State.OldWidth ) ||
+ ( height != window->State.OldHeight ) )
+ {
+ window->State.OldWidth = width;
+ window->State.OldHeight = height;
+ if( FETCH_WCB( *window, Reshape ) )
+ INVOKE_WCB( *window, Reshape, ( width, height ) );
+ else
+ {
+ fgSetWindow( window );
+ glViewport( 0, 0, width, height );
+ }
+ glutPostRedisplay( );
+ }
+ }
+ break;
+
+ case DestroyNotify:
+ /*
+ * This is sent to confirm the XDestroyWindow call.
+ * XXX WHY is this commented out? Should we re-enable it?