diff options
author | Simon Ser <contact@emersion.fr> | 2020-11-19 10:18:31 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-11-24 14:57:25 +0100 |
commit | f6c36f88816dcd6071e5e09ffc1bed88a74dc6d4 (patch) | |
tree | ee23433efbfa059322b2fae7b53a8b66f875d7b1 /backend | |
parent | 52805feae9bd6332c972065c799f4ac3b7ef2275 (diff) |
backend/x11: log unhandled X11 events
Diffstat (limited to 'backend')
-rw-r--r-- | backend/x11/backend.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c index 4472396e..2c91df71 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -39,6 +39,8 @@ struct wlr_x11_output *get_x11_output_from_window_id( } static void handle_x11_error(struct wlr_x11_backend *x11, xcb_value_error_t *ev); +static void handle_x11_unknown_event(struct wlr_x11_backend *x11, + xcb_generic_event_t *ev); static void handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *event) { @@ -77,6 +79,8 @@ static void handle_x11_event(struct wlr_x11_backend *x11, xcb_ge_generic_event_t *ev = (xcb_ge_generic_event_t *)event; if (ev->extension == x11->xinput_opcode) { handle_x11_xinput_event(x11, ev); + } else { + handle_x11_unknown_event(x11, event); } break; } @@ -85,6 +89,9 @@ static void handle_x11_event(struct wlr_x11_backend *x11, handle_x11_error(x11, ev); break; } + default: + handle_x11_unknown_event(x11, event); + break; } } @@ -370,3 +377,21 @@ log_raw: ev->major_opcode, ev->minor_opcode, ev->error_code, ev->sequence, ev->bad_value); } + +static void handle_x11_unknown_event(struct wlr_x11_backend *x11, + xcb_generic_event_t *ev) { +#if WLR_HAS_XCB_ERRORS + const char *extension; + const char *event_name = xcb_errors_get_name_for_xcb_event( + x11->errors_context, ev, &extension); + if (!event_name) { + wlr_log(WLR_DEBUG, "No name for unhandled event: %u", + ev->response_type); + return; + } + + wlr_log(WLR_DEBUG, "Unhandled X11 event: %s (%u)", event_name, ev->response_type); +#else + wlr_log(WLR_DEBUG, "Unhandled X11 event: %u", ev->response_type); +#endif +} |