Linux: Moved Display state booleans to java side

This commit is contained in:
Elias Naur 2006-07-03 18:33:25 +00:00
parent 2f957f816d
commit a417b8f15c
2 changed files with 47 additions and 58 deletions

View file

@ -97,6 +97,9 @@ final class LinuxDisplay implements DisplayImplementation {
private static boolean input_released;
private static boolean grab;
private static boolean focused;
private static boolean minimized;
private static boolean dirty;
private static boolean close_requested;
private static ByteBuffer current_cursor;
private static ByteBuffer blank_cursor;
@ -372,7 +375,10 @@ final class LinuxDisplay implements DisplayImplementation {
input_released = false;
pointer_grabbed = false;
keyboard_grabbed = false;
close_requested = false;
grab = false;
minimized = false;
dirty = true;
updateInputGrab();
nSetRepeatMode(getDisplay(), AutoRepeatModeOff);
} finally {
@ -548,41 +554,24 @@ final class LinuxDisplay implements DisplayImplementation {
private static native void nSetTitle(String title);
public boolean isCloseRequested() {
lockAWT();
try {
return nIsCloseRequested();
} finally {
unlockAWT();
}
boolean result = close_requested;
close_requested = false;
return result;
}
private static native boolean nIsCloseRequested();
public boolean isVisible() {
lockAWT();
try {
return nIsVisible();
} finally {
unlockAWT();
}
return !minimized;
}
private static native boolean nIsVisible();
public boolean isActive() {
lockAWT();
try {
return focused || isLegacyFullscreen();
} finally {
unlockAWT();
}
return focused || isLegacyFullscreen();
}
public boolean isDirty() {
lockAWT();
boolean result = nIsDirty();
unlockAWT();
boolean result = dirty;
dirty = false;
return result;
}
private static native boolean nIsDirty();
public PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException {
peer_info = new LinuxDisplayPeerInfo(pixel_format);
@ -1001,4 +990,22 @@ final class LinuxDisplay implements DisplayImplementation {
if (mouse != null)
mouse.handleWarpEvent(x, y);
}
private static void handleExposeEvent() {
dirty = true;
}
private static void handleUnmapNotifyEvent() {
dirty = true;
minimized = true;
}
private static void handleMapNotifyEvent() {
dirty = true;
minimized = false;
}
private static void handleCloseEvent() {
close_requested = true;
}
}