Now ungrabs the mouse when alert() is called
This commit is contained in:
parent
53202702b0
commit
309284a55e
|
@ -33,6 +33,8 @@ package org.lwjgl;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
|
@ -200,6 +202,10 @@ public final class Sys {
|
|||
* @param message The message text for the alert.
|
||||
*/
|
||||
public static void alert(String title, String message) {
|
||||
boolean grabbed = Mouse.isGrabbed();
|
||||
if (grabbed) {
|
||||
Mouse.setGrabbed(false);
|
||||
}
|
||||
String osName = System.getProperty("os.name");
|
||||
if (osName.startsWith("Windows")) {
|
||||
nAlert(title, message);
|
||||
|
@ -211,6 +217,9 @@ public final class Sys {
|
|||
Sys.log("Unable to display alert using: " + PLATFORM);
|
||||
}
|
||||
}
|
||||
if (grabbed) {
|
||||
Mouse.setGrabbed(true);
|
||||
}
|
||||
}
|
||||
|
||||
private static native void nAlert(String title, String message);
|
||||
|
|
Loading…
Reference in New Issue