X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_main.c;h=1fae543b98a81bc5182d31c1492a7787ca685f36;hb=9dac5d0710b760ba04ebb6bbe9ee61041232c700;hp=95b70dea7e211dc97139fae7a59dbdfe5e236be3;hpb=c48f25b614218f31ec6b0322bc4c1fe379151f10;p=freeglut diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 95b70de..1fae543 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -1384,6 +1384,10 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, window->State.MouseX = LOWORD( lParam ); window->State.MouseY = HIWORD( lParam ); #endif /* TARGET_HOST_WINCE */ + /* Restrict to [-32768, 32767] to match X11 behaviour */ + /* See comment in "freeglut_developer" mailing list 10/4/04 */ + if ( window->State.MouseX > 32767 ) window->State.MouseX -= 65536; + if ( window->State.MouseY > 32767 ) window->State.MouseY -= 65536; if ( window->ActiveMenu ) { @@ -1425,6 +1429,11 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, window->State.MouseY = HIWORD( lParam ); #endif /* TARGET_HOST_WINCE */ + /* Restrict to [-32768, 32767] to match X11 behaviour */ + /* See comment in "freeglut_developer" mailing list 10/4/04 */ + if ( window->State.MouseX > 32767 ) window->State.MouseX -= 65536; + if ( window->State.MouseY > 32767 ) window->State.MouseY -= 65536; + switch( uMsg ) { case WM_LBUTTONDOWN: @@ -1540,6 +1549,19 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, 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. + */ + if ( pressed == GL_TRUE ) + SetCapture ( window->Window.Handle ) ; + else + ReleaseCapture () ; + if( ! FETCH_WCB( *window, Mouse ) ) break;