X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_main.c;h=64c788454f13c46ec58fd52ea6f65de81322cd95;hb=075a7a7ef67011d9f2c2ae939bc287fa97fc1b8f;hp=34c3f79799ee7e5a7bf3bf4dcdb72ac457eab0c8;hpb=d3a7931b13fa9b9c343b1859fffe6433e64fc24c;p=freeglut diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 34c3f79..64c7884 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -265,7 +265,7 @@ static void fghcbCheckJoystickPolls( SFG_Window *window, SFG_Enumerator *enumera /* * Check if actually need to do the poll for the currently enumerated window: */ - if( window->State.JoystickLastPoll + window->State.JoystickPollRate >= checkTime ) + if( window->State.JoystickLastPoll + window->State.JoystickPollRate <= checkTime ) { /* * Yeah, that's it. Poll the joystick... @@ -1507,12 +1507,13 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara /* Save the current window and menu and set the current window to the window whose menu this is */ SFG_Window *save_window = fgStructure.Window ; SFG_Menu *save_menu = fgStructure.Menu ; + SFG_Window *parent_window = window->ActiveMenu->ParentWindow ; fgSetWindow ( window ) ; fgStructure.Menu = window->ActiveMenu ; /* Execute the menu callback */ fgExecuteMenuCallback ( window->ActiveMenu ) ; - fgDeactivateMenu ( window->ActiveMenu->ParentWindow ) ; + fgDeactivateMenu ( parent_window ) ; /* Restore the current window and menu */ fgSetWindow ( save_window ) ;