Linux: Added library unload destructor that resets keyboard repeat mode
This commit is contained in:
parent
839306597b
commit
ce673390d3
|
@ -163,7 +163,7 @@ static void setRepeatMode(JNIEnv *env, int mode) {
|
||||||
XKeyboardControl repeat_mode;
|
XKeyboardControl repeat_mode;
|
||||||
repeat_mode.auto_repeat_mode = mode;
|
repeat_mode.auto_repeat_mode = mode;
|
||||||
Display *disp = XOpenDisplay(NULL);
|
Display *disp = XOpenDisplay(NULL);
|
||||||
if (disp == NULL) {
|
if (disp == NULL && env != NULL) {
|
||||||
printfDebugJava(env, "Could not open display to set repeat mode");
|
printfDebugJava(env, "Could not open display to set repeat mode");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -171,6 +171,10 @@ static void setRepeatMode(JNIEnv *env, int mode) {
|
||||||
XCloseDisplay(disp);
|
XCloseDisplay(disp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __attribute__ ((destructor)) my_fini(void) {
|
||||||
|
setRepeatMode(NULL, AutoRepeatModeDefault);
|
||||||
|
}
|
||||||
|
|
||||||
static void setDecorations(int dec) {
|
static void setDecorations(int dec) {
|
||||||
Atom motif_hints_atom = XInternAtom(getDisplay(), "_MOTIF_WM_HINTS", False);
|
Atom motif_hints_atom = XInternAtom(getDisplay(), "_MOTIF_WM_HINTS", False);
|
||||||
MotifWmHints motif_hints;
|
MotifWmHints motif_hints;
|
||||||
|
|
Loading…
Reference in New Issue