From dfdf01af08eefeee3fac8014e600ab90e7ae2c7d Mon Sep 17 00:00:00 2001 From: vCaesar Date: Wed, 2 Nov 2016 00:39:33 +0800 Subject: [PATCH] Fix Unknown keycode name & IO error --- event/hook/x11/input_helper_c.h | 6 +++--- event/hook/x11/input_hook_c.h | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/event/hook/x11/input_helper_c.h b/event/hook/x11/input_helper_c.h index c6c9723..da6c76c 100644 --- a/event/hook/x11/input_helper_c.h +++ b/event/hook/x11/input_helper_c.h @@ -1874,9 +1874,9 @@ void load_input_helper(Display *disp) { } else #endif if (strncmp(layout_name, prefix_xfree86, strlen(prefix_xfree86)) != 0) { - logger(LOG_LEVEL_ERROR, - "%s [%u]: Unknown keycode name '%s', please file a bug report!\n", - __FUNCTION__, __LINE__, layout_name); + // logger(LOG_LEVEL_ERROR, + // "%s [%u]: Unknown keycode name '%s', please file a bug report!\n", + // __FUNCTION__, __LINE__, layout_name); } else if (layout_name == NULL) { logger(LOG_LEVEL_ERROR, diff --git a/event/hook/x11/input_hook_c.h b/event/hook/x11/input_hook_c.h index 4cb8325..9d22b0b 100644 --- a/event/hook/x11/input_hook_c.h +++ b/event/hook/x11/input_hook_c.h @@ -1098,6 +1098,10 @@ UIOHOOK_API int hook_stop() { // https://bugs.freedesktop.org/show_bug.cgi?id=42356#c4 //XFlush(hook->ctrl.display); XSync(hook->ctrl.display, False); + if (hook->ctrl.display) { + XCloseDisplay(hook->ctrl.display); + hook->ctrl.display = NULL; + } status = UIOHOOK_SUCCESS; }