Windows: Don't grab mouse when not focused

This commit is contained in:
Elias Naur 2008-04-08 10:40:26 +00:00
parent 48b37620c4
commit d0736741d9
1 changed files with 7 additions and 6 deletions

View File

@ -136,14 +136,15 @@ final class WindowsMouse {
if (grab) { if (grab) {
if (!mouse_grabbed) { if (!mouse_grabbed) {
mouse_grabbed = true; mouse_grabbed = true;
if (should_center) {
try { try {
WindowsDisplay.setupCursorClipping(hwnd); WindowsDisplay.setupCursorClipping(hwnd);
} catch (LWJGLException e) { } catch (LWJGLException e) {
LWJGLUtil.log("Failed to setup cursor clipping: " + e); LWJGLUtil.log("Failed to setup cursor clipping: " + e);
} }
if (should_center)
centerCursor(); centerCursor();
} }
}
} else { } else {
if (mouse_grabbed) { if (mouse_grabbed) {
mouse_grabbed = false; mouse_grabbed = false;