Allowing compilation of Windows version by removing DLL decorations from deprecated...
[freeglut] / src / freeglut_main.c
index c6d9c73..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: