Made all the "glutJoystickXXX" functions part of the freeglut extensions.
[freeglut] / src / freeglut_main.c
index 2fb73aa..8ade92b 100644 (file)
@@ -413,7 +413,7 @@ static int fghHaveJoystick( void )
 }
 static void fghHavePendingRedisplaysCallback( SFG_Window* w, SFG_Enumerator* e)
 {
-    if( w->State.Redisplay )
+    if( w->State.Redisplay && w->State.Visible )
     {
         e->found = GL_TRUE;
         e->data = w;
@@ -1085,7 +1085,6 @@ void FGAPIENTRY glutMainLoopEvent( void )
         case UnmapNotify:
             /* We get this when iconifying a window. */ 
             GETWINDOW( xunmap );
-            fgSetWindow( window );
             INVOKE_WCB( *window, WindowStatus, ( GLUT_HIDDEN ) );
             window->State.Visible = GL_FALSE;
             break;
@@ -1100,14 +1099,6 @@ void FGAPIENTRY glutMainLoopEvent( void )
 
         case VisibilityNotify:
         {
-            GETWINDOW( xvisibility );
-            /*
-             * XXX INVOKE_WCB() does this check for us.
-             */
-            if( ! FETCH_WCB( *window, WindowStatus ) )
-                break;
-            fgSetWindow( window );
-
             /*
              * Sending this event, the X server can notify us that the window
              * has just acquired one of the three possible visibility states:
@@ -1116,6 +1107,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
              * VisibilityNotify event when iconifying a window, we only get an
              * UnmapNotify then.
              */
+            GETWINDOW( xvisibility );
             switch( event.xvisibility.state )
             {
             case VisibilityUnobscured:
@@ -1599,13 +1591,13 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
 
             if( fgStructure.MenuContext )
                 wglMakeCurrent( window->Window.Device,
-                                fgStructure.MenuContext->Context
+                                fgStructure.MenuContext->MContext
                 );
             else
             {
                 fgStructure.MenuContext =
                     (SFG_MenuContext *)malloc( sizeof(SFG_MenuContext) );
-                fgStructure.MenuContext->Context =
+                fgStructure.MenuContext->MContext =
                     wglCreateContext( window->Window.Device );
             }