mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-21 06:14:10 +00:00
Mac OS X: Work around AWT shifting the fullscreen window off the screen
This commit is contained in:
parent
f65ae73d47
commit
45607a7c69
3 changed files with 18 additions and 2 deletions
|
|
@ -77,6 +77,7 @@ final class MacOSXDisplay implements DisplayImplementation {
|
|||
}
|
||||
|
||||
public void createWindow(DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException {
|
||||
hideUI(fullscreen);
|
||||
close_requested = false;
|
||||
try {
|
||||
frame = new MacOSXFrame(mode, requested_mode, fullscreen, x, y);
|
||||
|
|
@ -98,6 +99,7 @@ final class MacOSXDisplay implements DisplayImplementation {
|
|||
setView(null);
|
||||
frame.syncDispose();
|
||||
frame = null;
|
||||
hideUI(false);
|
||||
}
|
||||
|
||||
public int getGammaRampLength() {
|
||||
|
|
@ -222,6 +224,13 @@ final class MacOSXDisplay implements DisplayImplementation {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is an interface to the native Carbon call
|
||||
* SetSystemUIMode. It is used to hide the dock in a way
|
||||
* that will prevent AWT from shifting the fullscreen window
|
||||
*/
|
||||
private native void hideUI(boolean hide);
|
||||
|
||||
native void getMouseDeltas(IntBuffer delta_buffer);
|
||||
|
||||
private native void updateContext();
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ CC=gcc
|
|||
LINKER=gcc
|
||||
STRIP=strip
|
||||
CFLAGS_LINK=-dynamiclib -Wall
|
||||
FRAMEWORKS=-framework Foundation -framework AppKit -framework JavaVM
|
||||
FRAMEWORKS=-framework Foundation -framework AppKit -framework JavaVM -framework Carbon
|
||||
CFLAGS_O=-fPIC -O2 -D_MACOSX -Wall -c -I${AL}/include -I../common -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers
|
||||
SRC=$(wildcard *.m) $(wildcard *.c) $(wildcard ../common/*.c) $(wildcard ../common/arb/*.c) $(wildcard ../common/ati/*.c) $(wildcard ../common/ext/*.c) $(wildcard ../common/nv/*.c)
|
||||
OBJECTS=$(subst .m,.o, $(subst .c,.o,$(SRC)))
|
||||
|
|
|
|||
|
|
@ -153,7 +153,6 @@ static void setView(JNIEnv *env, jobject canvas) {
|
|||
usleep(WAIT_DELAY);
|
||||
}
|
||||
|
||||
// [gl_context clearDrawable];
|
||||
[gl_context setView:view];
|
||||
|
||||
[view unlockFocus];
|
||||
|
|
@ -163,6 +162,14 @@ static void setView(JNIEnv *env, jobject canvas) {
|
|||
awt.FreeDrawingSurface(ds);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_hideUI(JNIEnv *env, jobject this, jboolean hide) {
|
||||
if (hide == JNI_TRUE) {
|
||||
SetSystemUIMode(kUIModeContentSuppressed, 0);
|
||||
} else {
|
||||
SetSystemUIMode(kUIModeNormal, 0);
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_setVSyncEnabled(JNIEnv *env, jobject this, jboolean vsync) {
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
long vsync_value = vsync == JNI_TRUE ? 1 : 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue