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;
|
||||
repeat_mode.auto_repeat_mode = mode;
|
||||
Display *disp = XOpenDisplay(NULL);
|
||||
if (disp == NULL) {
|
||||
if (disp == NULL && env != NULL) {
|
||||
printfDebugJava(env, "Could not open display to set repeat mode");
|
||||
return;
|
||||
}
|
||||
|
@ -171,6 +171,10 @@ static void setRepeatMode(JNIEnv *env, int mode) {
|
|||
XCloseDisplay(disp);
|
||||
}
|
||||
|
||||
void __attribute__ ((destructor)) my_fini(void) {
|
||||
setRepeatMode(NULL, AutoRepeatModeDefault);
|
||||
}
|
||||
|
||||
static void setDecorations(int dec) {
|
||||
Atom motif_hints_atom = XInternAtom(getDisplay(), "_MOTIF_WM_HINTS", False);
|
||||
MotifWmHints motif_hints;
|
||||
|
|
Loading…
Reference in New Issue