backend/x11: log errors

Register an X11 error handler, and optionally use xcb-errors to print a
detailed message.
This commit is contained in:
Simon Ser 2020-11-18 19:06:45 +01:00
parent 262740bc9a
commit 52805feae9
2 changed files with 66 additions and 1 deletions

View file

@ -1,14 +1,19 @@
#ifndef BACKEND_X11_H
#define BACKEND_X11_H
#include <wlr/config.h>
#include <stdbool.h>
#include <X11/Xlib-xcb.h>
#include <wayland-server-core.h>
#include <xcb/xcb.h>
#if WLR_HAS_XCB_ERRORS
#include <xcb/xcb_errors.h>
#endif
#include <wlr/backend/x11.h>
#include <wlr/config.h>
#include <wlr/interfaces/wlr_input_device.h>
#include <wlr/interfaces/wlr_keyboard.h>
#include <wlr/interfaces/wlr_output.h>
@ -81,6 +86,10 @@ struct wlr_x11_backend {
// The time we last received an event
xcb_timestamp_t time;
#if WLR_HAS_XCB_ERRORS
xcb_errors_context_t *errors_context;
#endif
uint8_t xinput_opcode;
struct wl_listener display_destroy;