X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmswin%2Ffg_main_mswin.c;h=e4fcce5689329f1c05d270a54fd4e08687304bc8;hb=2a3de201be57b04bff0a26a7607bc1d6fef2ea88;hp=d3041696015bcc06eabc32b0ab63076c5f2e9bf3;hpb=065ac95b77b53e025a219da8c7ac31ee2b32dbc5;p=freeglut diff --git a/src/mswin/fg_main_mswin.c b/src/mswin/fg_main_mswin.c index d304169..e4fcce5 100644 --- a/src/mswin/fg_main_mswin.c +++ b/src/mswin/fg_main_mswin.c @@ -736,17 +736,16 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR window->State.MouseX, window->State.MouseY ) ) break; - /* Set capture so that the window captures all the mouse messages */ - /* - * XXX - Multiple button support: Under X11, the mouse is not released - * XXX - from the window until all buttons have been released, even if the - * XXX - user presses a button in another window. This will take more - * XXX - code changes than I am up to at the moment (10/5/04). The present - * XXX - is a 90 percent solution. + /* Set capture so that the window captures all the mouse messages + * + * The mouse is not released from the window until all buttons have + * been released, even if the user presses a button in another window. + * This is consistent with the behavior on X11. */ if ( pressed == GL_TRUE ) SetCapture ( window->Window.Handle ) ; - else + else if (!GetAsyncKeyState(VK_LBUTTON) && !GetAsyncKeyState(VK_MBUTTON) && !GetAsyncKeyState(VK_RBUTTON)) + /* Make sure all mouse buttons are released before releasing capture */ ReleaseCapture () ; if( ! FETCH_WCB( *window, Mouse ) ) @@ -765,6 +764,9 @@ LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPAR ); fgState.Modifiers = INVALID_MODIFIERS; + + /* As per docs, should return zero */ + lRet = 0; } break;