X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_main.c;h=10604d05b5facc53d3253647a2f6af70694daee8;hb=027fcf9e66356b06563140740f8d1c7bc05c9987;hp=2189c41ad0610a0d5161648eae465975a99e7fb2;hpb=71968c367fd725119878eb2d2225171a647002e8;p=freeglut diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 2189c41..10604d0 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -1290,7 +1290,10 @@ void FGAPIENTRY glutMainLoopEvent( void ) /* Cease processing this event if it is auto repeated */ if (window->State.KeyRepeating) + { + if (event.type == KeyPress) window->State.KeyRepeating = GL_FALSE; break; + } if( event.type == KeyPress ) { @@ -1389,6 +1392,10 @@ void FGAPIENTRY glutMainLoopEvent( void ) case ReparentNotify: break; /* XXX Should disable this event */ + /* Not handled */ + case GravityNotify: + break; + default: fgWarning ("Unknown X event type: %d\n", event.type); break; @@ -1545,7 +1552,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, { SFG_Window* window; PAINTSTRUCT ps; - LONG lRet = 1; + LRESULT lRet = 1; FREEGLUT_INTERNAL_ERROR_EXIT_IF_NOT_INITIALISED ( "Event Handler" ) ; @@ -1609,8 +1616,15 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, } window->State.NeedToResize = GL_TRUE; - window->State.Width = fgState.Size.X; - window->State.Height = fgState.Size.Y; + if( ( window->State.Width < 0 ) || ( window->State.Height < 0 ) ) + { + SFG_Window *current_window = fgStructure.CurrentWindow; + + fgSetWindow( window ); + window->State.Width = glutGet( GLUT_WINDOW_WIDTH ); + window->State.Height = glutGet( GLUT_WINDOW_HEIGHT ); + fgSetWindow( current_window ); + } ReleaseDC( window->Window.Handle, window->Window.Device ); @@ -2078,7 +2092,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, GetKeyboardState( state ); - if( ToAscii( wParam, 0, state, code, 0 ) == 1 ) + if( ToAscii( (UINT)wParam, 0, state, code, 0 ) == 1 ) wParam=code[ 0 ]; INVOKE_WCB( *window, KeyboardUp,