X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_main.c;h=8ade92bc70c81cd28f8b1e12ce4c4405825b172c;hb=f0fa306fbd7cb7a61d5b9229c808ff66c858331f;hp=2fb73aa55a77c9039bc1082aa3fee5d56493de1c;hpb=e9a96a71a2feff9da7ccae395c5f316e67af3bd0;p=freeglut diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 2fb73aa..8ade92b 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -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 ); }