From: <ma...@us...> - 2010-03-17 18:56:09
|
Revision: 3290 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3290&view=rev Author: matzon Date: 2010-03-17 18:55:59 +0000 (Wed, 17 Mar 2010) Log Message: ----------- patch as per http://lwjgl.org/forum/index.php/topic,3124.0.html Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2010-03-16 19:05:19 UTC (rev 3289) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2010-03-17 18:55:59 UTC (rev 3290) @@ -690,15 +690,16 @@ if (mouse != null) { mouse.handleMouseButton((byte)button, (byte)state, millis); + // need to capture? + if (captureMouse == -1 && button != -1 && state == 1) { + captureMouse = button; + nSetCapture(hwnd); + } + // done with capture? if(captureMouse != -1 && button == captureMouse && state == 0) { - nReleaseCapture(); captureMouse = -1; - - // force mouse update - else we will run into an issue where the - // button state is "stale" while captureMouse == -1 which causes - // handleMouseMoved to issue a setCapture. - Mouse.poll(); + nReleaseCapture(); } } @@ -714,16 +715,6 @@ private void handleMouseMoved(int x, int y, long millis) { if (mouse != null) { mouse.handleMouseMoved(x, y, millis, shouldGrab()); - - // Moving - while mouse is down? - // need to capture - if(!Mouse.isGrabbed()) { - int button = firstMouseButtonDown(); - if(captureMouse == -1 && button != -1) { - captureMouse = button; - nSetCapture(hwnd); - } - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |