Linux fixes
This commit is contained in:
parent
4cdf7f855d
commit
c267f6d5da
|
@ -51,8 +51,8 @@ if test "x$JAVA_HOME" = x; then
|
|||
else
|
||||
AC_MSG_RESULT($JAVA_HOME)
|
||||
JAVA_HOME="$JAVA_HOME"
|
||||
CPPFLAGS="$CPPFLAGS -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
|
||||
CFLAGS="$CFLAGS -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
|
||||
CPPFLAGS="$CPPFLAGS -D_DEBUG -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
|
||||
CFLAGS="$CFLAGS -D_DEBUG -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
|
||||
fi
|
||||
|
||||
dnl Checks for libraries.
|
||||
|
|
|
@ -75,7 +75,7 @@ static bool getVidModeExtensionVersion(Display *disp, int screen, int *major, in
|
|||
return false;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
printf("XF86VidMode extension version %i.%i\n", major, minor);
|
||||
printf("XF86VidMode extension version %i.%i\n", *major, *minor);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ static void grabKeyboard(void) {
|
|||
if (result == GrabSuccess) {
|
||||
keyboard_grabbed = true;
|
||||
setRepeatMode(AutoRepeatModeOff);
|
||||
XFlush(getCurrentDisplay());
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
@ -100,6 +101,7 @@ static void ungrabKeyboard(void) {
|
|||
if (keyboard_grabbed) {
|
||||
keyboard_grabbed = false;
|
||||
XUngrabKeyboard(getCurrentDisplay(), CurrentTime);
|
||||
XFlush(getCurrentDisplay());
|
||||
}
|
||||
setRepeatMode(AutoRepeatModeDefault);
|
||||
}
|
||||
|
@ -132,11 +134,6 @@ void releaseKeyboard(void) {
|
|||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nCreate
|
||||
(JNIEnv * env, jclass clazz)
|
||||
{
|
||||
keyboard_grabbed = false;
|
||||
translation_enabled = false;
|
||||
buffer_enabled = false;
|
||||
should_grab = true;
|
||||
updateGrab();
|
||||
for (int i = 0; i < KEYBOARD_SIZE; i++)
|
||||
key_map[i] = i;
|
||||
key_map[0x6b] = 0xdb; // Left doze key
|
||||
|
@ -160,6 +157,11 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nCreate
|
|||
|
||||
memset(key_buf, 0, KEYBOARD_SIZE*sizeof(unsigned char));
|
||||
created = true;
|
||||
keyboard_grabbed = false;
|
||||
translation_enabled = false;
|
||||
buffer_enabled = false;
|
||||
should_grab = true;
|
||||
updateGrab();
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -137,6 +137,7 @@ static void grabPointer(void) {
|
|||
pointer_grabbed = true;
|
||||
// make sure we have a centered window
|
||||
XF86VidModeSetViewPort(getCurrentDisplay(), getCurrentScreen(), 0, 0);
|
||||
XFlush(getCurrentDisplay());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -146,6 +147,7 @@ static void ungrabPointer(void) {
|
|||
if (pointer_grabbed) {
|
||||
pointer_grabbed = false;
|
||||
XUngrabPointer(getCurrentDisplay(), CurrentTime);
|
||||
XFlush(getCurrentDisplay());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue