Linux: Fix Mouse.setCursorPosition()

This commit is contained in:
Elias Naur 2005-10-10 09:11:24 +00:00
parent 0b1939dce5
commit 94f39655a5
1 changed files with 1 additions and 8 deletions

View File

@ -344,14 +344,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nReadMouse(JNIEnv *env
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetCursorPosition(JNIEnv * env, jclass clazz, jint x, jint y) {
XWindowAttributes attributes;
if (!XGetWindowAttributes(getDisplay(), getCurrentWindow(), &attributes)) {
printfDebugJava(env, "XGetWindowAttributes failed");
return;
}
int transformed_x = attributes.x + x;
int transformed_y = attributes.y + transformY(y);
XWarpPointer(getDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, transformed_x, transformed_y);
XWarpPointer(getDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, x, transformY(y));
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGrabMouse(JNIEnv * env, jclass clazz, jboolean new_grab) {