diff --git a/src/native/common/common_tools.c b/src/native/common/common_tools.c index 7d1fe8ad..5ec7e9ad 100644 --- a/src/native/common/common_tools.c +++ b/src/native/common/common_tools.c @@ -70,6 +70,22 @@ void setDebugEnabled(bool enable) { debug = enable; } +void printfDebugJava(JNIEnv *env, const char *format, ...) { + #define BUFFER_SIZE 4000 + static char buffer[BUFFER_SIZE]; + va_list ap; + va_start(ap, format); + if (isDebugEnabled()) { + vsnprintf(buffer, BUFFER_SIZE, format, ap); + buffer[BUFFER_SIZE - 1] = '\0'; + jstring str = (*env)->NewStringUTF(env, buffer); + jclass org_lwjgl_Sys_class = (*env)->FindClass(env, "org/lwjgl/Sys"); + jmethodID log_method = (*env)->GetMethodID(env, org_lwjgl_Sys_class, "log", "(Ljava/lang/String;)V"); + (*env)->CallStaticVoidMethod(env, org_lwjgl_Sys_class, log_method, str); + } + va_end(ap); +} + void printfDebug(const char *format, ...) { va_list ap; va_start(ap, format); diff --git a/src/native/common/common_tools.h b/src/native/common/common_tools.h index 6a1beb24..149ff519 100644 --- a/src/native/common/common_tools.h +++ b/src/native/common/common_tools.h @@ -130,6 +130,7 @@ extern void throwException(JNIEnv *env, const char *msg); extern void throwOpenALException(JNIEnv * env, const char * err); extern void throwFMODException(JNIEnv * env, const char * err); extern void setDebugEnabled(bool enable); +extern void printfDebugJava(JNIEnv *env, const char *format, ...); extern void printfDebug(const char *format, ...); extern bool getBooleanProperty(JNIEnv *env, const char* propertyName); extern char * GetStringNativeChars(JNIEnv *env, jstring jstr); diff --git a/src/native/linux/org_lwjgl_opengl_Display.c b/src/native/linux/org_lwjgl_opengl_Display.c index a84ad744..93a7b84e 100644 --- a/src/native/linux/org_lwjgl_opengl_Display.c +++ b/src/native/linux/org_lwjgl_opengl_Display.c @@ -785,7 +785,7 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_isCloseRequested JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_isActive (JNIEnv *env, jobject this) { - return focused ? JNI_TRUE : JNI_FALSE; + return focused || isLegacyFullscreen() ? JNI_TRUE : JNI_FALSE; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_setVSyncEnabled