- switch( event.type )
- {
- case CreateNotify:
- /*
- * The window creation confirmation
- */
- break;
-
- case DestroyNotify:
- /*
- * This is sent to confirm the XDestroyWindow call.
- */
- /*
- * Call the window closure callback, remove from the structure, etc.
- */
-/* fgAddToWindowDestroyList ( window, FALSE ); */
-
- break;
-
- case ClientMessage:
- /*
- * Destroy the window when the WM_DELETE_WINDOW message arrives
- */
- if( (Atom) event.xclient.data.l[ 0 ] == fgDisplay.DeleteWindow )
- {
- GETWINDOW( xclient );
-
- /*
- * Call the XWindows functions to close the window
- */
- fgCloseWindow ( window ) ;
-
- /*
- * Call the window closure callback, remove from the structure, etc.
- */
- fgAddToWindowDestroyList ( window, FALSE );
- }
- break;
-
- case UnmapNotify:
- /*
- * A window of ours has been unmapped...
- */
- break;
-
- case Expose:
- /*
- * We are too dumb to process partial exposes...
- */
- if( event.xexpose.count == 0 )
- fghRedrawWindowByHandle( event.xexpose.window );
- break;
-
- case ConfigureNotify:
- /*
- * The window gets resized
- */
- fghReshapeWindowByHandle(
- event.xconfigure.window,
- event.xconfigure.width,
- event.xconfigure.height
- );
- break;
-
- case MappingNotify:
- /*
- * Have the client's keyboard knowledge updated (xlib.ps,
- * page 206, says that's a good thing to do)
- */
- XRefreshKeyboardMapping( (XMappingEvent *) &event );
- break;
-
- case VisibilityNotify:
- {
- /*
- * The window's visiblity might have changed
- */
- GETWINDOW( xvisibility );
-
- /*
- * Break now if no window status callback has been hooked to that window
- */
- if( window->Callbacks.WindowStatus == NULL )
- break;
-
- /*
- * We're going to send a callback to a window. Make it current.
- */
- fgSetWindow( window );
-
- /*
- * Sending this event, the X server can notify us that the window has just
- * acquired one of the three possible visibility states: VisibilityUnobscured,
- * VisibilityPartiallyObscured or VisibilityFullyObscured
- */
- switch( event.xvisibility.state )
- {
- case VisibilityUnobscured:
- /*
- * We are fully visible...
- */
- window->Callbacks.WindowStatus( GLUT_FULLY_RETAINED );
- window->State.Visible = TRUE;
- break;