From abd5989ee867e53852311994da3ad2548fb12118 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 21 Jul 2025 10:38:51 +1000 Subject: [PATCH] plugin: prevent potential keycode leakage to the logs Mixup of #if vs #ifdef caused this condition to always be treated as true, resulting in leakage of key codes to the logs if the libinput log level was set to debug. Fixes: 7137eb9702f1 ("plugin: add ability to queue more events in the evdev_frame callback") Closes #1163 Part-of: --- meson.build | 4 +++- src/libinput-plugin-tablet-double-tool.c | 2 +- src/libinput.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 6a5d43ba..d6774c0d 100644 --- a/meson.build +++ b/meson.build @@ -376,7 +376,9 @@ else endif ############ libinput.so ############ -config_h.set10('EVENT_DEBUGGING', get_option('internal-event-debugging')) +if get_option('internal-event-debugging') + config_h.set('EVENT_DEBUGGING', 1) +endif install_headers('src/libinput.h') src_libinput = src_libfilter + [ diff --git a/src/libinput-plugin-tablet-double-tool.c b/src/libinput-plugin-tablet-double-tool.c index 9642cb82..eacdc632 100644 --- a/src/libinput-plugin-tablet-double-tool.c +++ b/src/libinput-plugin-tablet-double-tool.c @@ -180,7 +180,7 @@ double_tool_plugin_device_handle_frame(struct libinput_plugin *libinput_plugin, bool eraser_toggled = eraser_toggle != NULL; bool pen_toggled = pen_toggle != NULL; -#if EVENT_DEBUGGING +#ifdef EVENT_DEBUGGING plugin_log_debug(libinput_plugin, "device %s: tool state: pen:%s eraser:%s\n", libinput_device_get_name(device->device), diff --git a/src/libinput.c b/src/libinput.c index d2412f21..fff337a0 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -3225,7 +3225,7 @@ libinput_post_event(struct libinput *libinput, struct libinput_event *event) size_t move_len; size_t new_out; -#if EVENT_DEBUGGING +#ifdef EVENT_DEBUGGING libinput_print_queued_event(event); #endif