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