Make setting keyboard rate use own X connection

This commit is contained in:
Elias Naur 2004-07-24 22:17:03 +00:00
parent c17a6fe481
commit 401a3a859f
1 changed files with 8 additions and 2 deletions

View File

@ -166,7 +166,13 @@ static void updateInputGrab(void) {
static void setRepeatMode(int mode) {
XKeyboardControl repeat_mode;
repeat_mode.auto_repeat_mode = mode;
XChangeKeyboardControl(getDisplay(), KBAutoRepeatMode, &repeat_mode);
Display *disp = XOpenDisplay(NULL);
if (disp == NULL) {
printfDebug("Could not open display to set repeat mode\n");
return;
}
XChangeKeyboardControl(disp, KBAutoRepeatMode, &repeat_mode);
XCloseDisplay(disp);
}
bool releaseInput(void) {
@ -281,11 +287,11 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nSetTitle
}
static void destroyWindow(void) {
setRepeatMode(AutoRepeatModeDefault);
if (USEGLX13)
glXDestroyWindow(getDisplay(), glx_window);
XDestroyWindow(getDisplay(), current_win);
XFreeColormap(getDisplay(), cmap);
setRepeatMode(AutoRepeatModeDefault);
}
static bool createWindow(JNIEnv* env, int width, int height) {