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