Improve the event queuing debugging a bit

Print a bit more information if this ifdef is disabled for
debugging, in this case for button events. That's all
I need for now, we can extend later.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1122>
This commit is contained in:
Peter Hutterer 2024-12-23 21:54:23 +10:00
parent 5388299117
commit 530ca423a7

View file

@ -3183,7 +3183,19 @@ libinput_post_event(struct libinput *libinput,
size_t new_out;
#if 0
log_debug(libinput, "Queuing %s\n", event_type_to_str(event->type));
char buf[1024] = { 0 };
switch (event->type) {
case LIBINPUT_EVENT_POINTER_BUTTON: {
struct libinput_event_pointer *pev = libinput_event_get_pointer_event(event);
snprintf(buf, sizeof(buf), "button: %u, state %s",
libinput_event_pointer_get_button(pev),
libinput_event_pointer_get_button_state(pev) == LIBINPUT_BUTTON_STATE_PRESSED ? "press" : "released");
break;
}
default:
break;
}
log_debug(libinput, "Queuing %s { %s }\n", event_type_to_str(event->type), buf);
#endif
events_count++;