Now ungrabs the mouse when alert() is called

This commit is contained in:
Caspian Rychlik-Prince 2004-08-13 15:24:47 +00:00
parent 53202702b0
commit 309284a55e
1 changed files with 9 additions and 0 deletions

View File

@ -33,6 +33,8 @@ package org.lwjgl;
import java.io.IOException; import java.io.IOException;
import org.lwjgl.input.Mouse;
/** /**
* $Id$ * $Id$
* *
@ -200,6 +202,10 @@ public final class Sys {
* @param message The message text for the alert. * @param message The message text for the alert.
*/ */
public static void alert(String title, String message) { public static void alert(String title, String message) {
boolean grabbed = Mouse.isGrabbed();
if (grabbed) {
Mouse.setGrabbed(false);
}
String osName = System.getProperty("os.name"); String osName = System.getProperty("os.name");
if (osName.startsWith("Windows")) { if (osName.startsWith("Windows")) {
nAlert(title, message); nAlert(title, message);
@ -211,6 +217,9 @@ public final class Sys {
Sys.log("Unable to display alert using: " + PLATFORM); Sys.log("Unable to display alert using: " + PLATFORM);
} }
} }
if (grabbed) {
Mouse.setGrabbed(true);
}
} }
private static native void nAlert(String title, String message); private static native void nAlert(String title, String message);