Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit 92676f9

Browse files
committed
Disable grab compute on direct calls to avoid jumps in LWJGL2 versions
1 parent a60f868 commit 92676f9

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20210116
1+
20210117

app_pojavlauncher/src/main/jni/input_bridge_v3.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendCursorPos(JN
261261
isCursorEntered = true;
262262
}
263263
}
264-
264+
265265
if (isGrabbing) {
266266
if (!isPrepareGrabPos) {
267267
grabCursorX += x - lastCursorX;
@@ -276,9 +276,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendCursorPos(JN
276276
return;
277277
}
278278
}
279-
279+
280280
if (!isUseStackQueueCall) {
281-
GLFW_invoke_CursorPos(showingWindow, (double) (isGrabbing ? grabCursorX : x), (double) (isGrabbing ? grabCursorY : y));
281+
GLFW_invoke_CursorPos(showingWindow, (double) (x), (double) (y));
282282
} else {
283283
sendData(EVENT_TYPE_CURSOR_POS, (isGrabbing ? grabCursorX : x), (isGrabbing ? grabCursorY : y), 0, 0);
284284
}

jre_lwjgl3glfw/src/main/java/org/lwjgl/input/GLFWInputImplementation.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,9 @@ public void putMouseEventWithCoords(byte button, byte state, int coord1, int coo
144144
int acoord1=0;
145145
int acoord2=0;
146146
if(coord1 == -1 && coord2 == -1) {
147-
acoord1 = mouseComparatorX;
148-
acoord2 = mouseComparatorY;
147+
acoord1 = mouseX;
148+
acoord2 = mouseY;
149149
}else{
150-
mouseComparatorX = coord1;
151-
mouseComparatorY = coord2;
152150
acoord1 = coord1;
153151
acoord2= coord2;
154152
}

0 commit comments

Comments
 (0)