X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmswin%2Ffg_main_mswin.c;h=a35bfca155f0e63bec8660a69a41a3d3930a10de;hb=9721970dce1ebac6b6bb3c7b0b84fdada7216270;hp=ad80055345147aa8555cdf4db5ef208d61a7945e;hpb=7094cf70ed46d1e6f0ef900b53c8af039933354e;p=freeglut diff --git a/src/mswin/fg_main_mswin.c b/src/mswin/fg_main_mswin.c index ad80055..a35bfca 100644 --- a/src/mswin/fg_main_mswin.c +++ b/src/mswin/fg_main_mswin.c @@ -296,7 +296,7 @@ static LRESULT fghWindowProcKeyPress(SFG_Window *window, UINT uMsg, GLboolean ke wParam=code[ 0 ]; INVOKE_WCB( *window, KeyboardUp, - ( (char)wParam, + ( (char)(wParam & 0xFF), /* and with 0xFF to indicate to runtime that we want to strip out higher bits - otherwise we get a runtime error when "Smaller Type Checks" is enabled */ window->State.MouseX, window->State.MouseY ) ); } @@ -589,9 +589,20 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR fgPlatformCheckMenuDeactivate(); break; + case WM_MOUSEACTIVATE: + /* Clicks should not activate the menu. + * Especially important when clicking on a menu's submenu item which has no effect. + */ + printf("WM_MOUSEACTIVATE\n"); + if (window->IsMenu) + lRet = MA_NOACTIVATEANDEAT; + else + lRet = DefWindowProc( hWnd, uMsg, wParam, lParam ); + break; + #if 0 case WM_ACTIVATE: - //printf("WM_ACTIVATE: %x (ID: %i) %d %d\n",lParam, window->ID, HIWORD(wParam), LOWORD(wParam)); + /* printf("WM_ACTIVATE: %x (ID: %i) %d %d\n",lParam, window->ID, HIWORD(wParam), LOWORD(wParam)); */ if (LOWORD(wParam) != WA_INACTIVE) { /* printf("WM_ACTIVATE: fgSetCursor( %p, %d)\n", window, @@ -629,7 +640,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR tme.hwndTrack = window->Window.Handle; TrackMouseEvent(&tme); - window->State.pWState.MouseTracking = GL_TRUE; + window->State.pWState.MouseTracking = TRUE; } } } @@ -648,7 +659,7 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR INVOKE_WCB( *window, Entry, ( GLUT_LEFT ) ); fgSetWindow(saved_window); - window->State.pWState.MouseTracking = GL_FALSE; + window->State.pWState.MouseTracking = FALSE; lRet = 0; /* As per docs, must return zero */ } break; @@ -981,6 +992,12 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR /* Help screen says this message must be passed to "DefWindowProc" */ break; + case WM_DISPLAYCHANGE: /* 0x007E */ + /* The system display resolution/depth has changed */ + fgDisplay.ScreenWidth = LOWORD(lParam); + fgDisplay.ScreenHeight = HIWORD(lParam); + break; + case WM_SYSCOMMAND : /* 0x0112 */ { /*