X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmswin%2Ffg_main_mswin.c;h=97b83631c53a4fda609d60ca481e5f766e2db3a3;hb=cae6701c343e3a42bc9504f14e6d83e4ca9d8119;hp=137fc06a881a5220ddec8afa0a68000392447d1f;hpb=877862d97a18a5ee6231d46bf7e3fb63b6cada39;p=freeglut diff --git a/src/mswin/fg_main_mswin.c b/src/mswin/fg_main_mswin.c index 137fc06..97b8363 100644 --- a/src/mswin/fg_main_mswin.c +++ b/src/mswin/fg_main_mswin.c @@ -1,5 +1,5 @@ /* - * freeglut_main_mswin.c + * fg_main_mswin.c * * The Windows-specific mouse cursor related stuff. * @@ -1543,6 +1543,16 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR break; } #endif + //Added by Jinrong Xie (stonexjr@gmail.com) 12/24/2014 + //for SpaceNavigator support on Windows. + /* + case WM_ACTIVATEAPP: + fgInitialiseSpaceball(); + break; + */ + case WM_INPUT: + fgSpaceballHandleWinEvent(hWnd, wParam, lParam); + break; default: /* Handle unhandled messages */ lRet = DefWindowProc( hWnd, uMsg, wParam, lParam ); @@ -1640,8 +1650,7 @@ void fgPlatformPosResZordWork(SFG_Window* window, unsigned int workMask) /* For fullscreen mode, find the monitor that is covered the most * by the window and get its rect as the resize target. */ - GetWindowRect(window->Window.Handle, &rect); - hMonitor= MonitorFromRect(&rect, MONITOR_DEFAULTTONEAREST); + hMonitor= MonitorFromWindow(window->Window.Handle, MONITOR_DEFAULTTONEAREST); mi.cbSize = sizeof(mi); GetMonitorInfo(hMonitor, &mi); rect = mi.rcMonitor; @@ -1759,8 +1768,8 @@ void fgPlatformVisibilityWork(SFG_Window* window) win = win->Parent; break; case DesireNormalState: - if (win->IsMenu && (!fgStructure.GameModeWindow || win->ActiveMenu->ParentWindow != fgStructure.GameModeWindow)) - cmdShow = SW_SHOWNA; /* Just show, don't activate window if its a menu. Only exception is when the parent is a gamemode window as the menu would pop under it when we do this... */ + if (win->IsMenu && !fgStructure.GameModeWindow) + cmdShow = SW_SHOWNA; /* Just show, don't activate window if its a menu. Only exception is when there is a gamemode window as the menu would pop under it when we do this... */ else cmdShow = SW_SHOW; break;