mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-18 00:59:35 -04:00
Fix 1.13+ mouse not working when pressing too soon
This commit is contained in:
parent
e42251a836
commit
2ad0a2ff42
@ -36,6 +36,7 @@ public class CallbackBridge {
|
|||||||
|
|
||||||
public static void sendCursorPos(float x, float y) {
|
public static void sendCursorPos(float x, float y) {
|
||||||
if (!threadAttached) {
|
if (!threadAttached) {
|
||||||
|
nativeSetUseInputStackQueue(BaseMainActivity.isInputStackCall);
|
||||||
threadAttached = CallbackBridge.nativeAttachThreadToOther(true, BaseMainActivity.isInputStackCall);
|
threadAttached = CallbackBridge.nativeAttachThreadToOther(true, BaseMainActivity.isInputStackCall);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,6 +199,7 @@ public class CallbackBridge {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static native void nativeSetUseInputStackQueue(boolean useInputStackQueue);
|
||||||
public static native boolean nativeAttachThreadToOther(boolean isAndroid, boolean isUsePushPoll);
|
public static native boolean nativeAttachThreadToOther(boolean isAndroid, boolean isUsePushPoll);
|
||||||
|
|
||||||
private static native boolean nativeSendChar(char codepoint);
|
private static native boolean nativeSendChar(char codepoint);
|
||||||
|
@ -159,14 +159,20 @@ void closeGLFWWindow() {
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_org_lwjgl_glfw_CallbackBridge_nativeSetUseInputStackQueue(JNIEnv *env, jclass clazz,
|
||||||
|
jboolean use_input_stack_queue) {
|
||||||
|
isUseStackQueueCall = (int) use_input_stack_queue;
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeAttachThreadToOther(JNIEnv* env, jclass clazz, jboolean isAndroid, jboolean isUseStackQueueBool) {
|
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeAttachThreadToOther(JNIEnv* env, jclass clazz, jboolean isAndroid, jboolean isUseStackQueueBool) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
LOGD("Debug: JNI attaching thread, isUseStackQueue=%d\n", isUseStackQueue);
|
LOGD("Debug: JNI attaching thread, isUseStackQueue=%d\n", isUseStackQueueBool);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
jboolean result;
|
jboolean result;
|
||||||
|
|
||||||
isUseStackQueueCall = (int) isUseStackQueueBool;
|
//isUseStackQueueCall = (int) isUseStackQueueBool;
|
||||||
if (isAndroid) {
|
if (isAndroid) {
|
||||||
result = attachThread(true, &runtimeJNIEnvPtr_ANDROID);
|
result = attachThread(true, &runtimeJNIEnvPtr_ANDROID);
|
||||||
} else {
|
} else {
|
||||||
@ -256,7 +262,13 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendCursorEnter(
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendCursorPos(JNIEnv* env, jclass clazz, jfloat x, jfloat y) {
|
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendCursorPos(JNIEnv* env, jclass clazz, jfloat x, jfloat y) {
|
||||||
|
#ifdef DEBUG
|
||||||
|
LOGD("Sending cursor position \n");
|
||||||
|
#endif
|
||||||
if (GLFW_invoke_CursorPos && isInputReady) {
|
if (GLFW_invoke_CursorPos && isInputReady) {
|
||||||
|
#ifdef DEBUG
|
||||||
|
LOGD("GLFW_invoke_CursorPos && isInputReady \n");
|
||||||
|
#endif
|
||||||
if (!isCursorEntered) {
|
if (!isCursorEntered) {
|
||||||
if (GLFW_invoke_CursorEnter) {
|
if (GLFW_invoke_CursorEnter) {
|
||||||
isCursorEntered = true;
|
isCursorEntered = true;
|
||||||
@ -380,4 +392,3 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSetWindowAttrib(
|
|||||||
(jlong) showingWindow, attrib, value
|
(jlong) showingWindow, attrib, value
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user