From d834e19a23aa808201323df3513cdcf1dc4e0d0b Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 14 Apr 2009 11:49:55 +0200 Subject: [PATCH] awesome: use xcb_event error code Signed-off-by: Julien Danjou --- awesome.c | 35 +++++++++++------------------------ awesomeConfig.cmake | 2 +- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/awesome.c b/awesome.c index dbf25a9f0..febd3cccc 100644 --- a/awesome.c +++ b/awesome.c @@ -273,33 +273,20 @@ xerror(void *data __attribute__ ((unused)), xcb_connection_t *c __attribute__ ((unused)), xcb_generic_error_t *e) { - xutil_error_t err; - - if(!xutil_error_init(e, &err)) + /* ignore this */ + if(e->error_code == XCB_EVENT_ERROR_BAD_WINDOW + || (e->error_code == XCB_EVENT_ERROR_BAD_MATCH + && XCB_EVENT_REQUEST_TYPE(e) == XCB_SET_INPUT_FOCUS) + || (e->error_code == XCB_EVENT_ERROR_BAD_VALUE + && XCB_EVENT_REQUEST_TYPE(e) == XCB_KILL_CLIENT) + || (XCB_EVENT_REQUEST_TYPE(e) == XCB_CONFIGURE_WINDOW + && e->error_code == XCB_EVENT_ERROR_BAD_MATCH)) return 0; - /* ignore this */ - if(e->error_code == XUTIL_BAD_WINDOW - || (e->error_code == XUTIL_BAD_MATCH && err.request_code == XCB_SET_INPUT_FOCUS) - || (e->error_code == XUTIL_BAD_VALUE && err.request_code == XCB_KILL_CLIENT) - || (err.request_code == XCB_CONFIGURE_WINDOW && e->error_code == XUTIL_BAD_MATCH)) - goto bailout; + warn("X error: request=%s, error=%s", + xcb_event_get_request_label(XCB_EVENT_REQUEST_TYPE(e)), + xcb_event_get_error_label(e->error_code)); - warn("X error: request=%s, error=%s", err.request_label, err.error_label); - - /* - * Xlib code was using default X error handler, namely - * '_XDefaultError()', which displays more informations about the - * error and also exit if 'error_code'' equals to - * 'BadImplementation' - * - * \todo display more informations about the error (like the Xlib default error handler) - */ - if(e->error_code == XUTIL_BAD_IMPLEMENTATION) - fatal("X error: request=%s, error=%s", err.request_label, err.error_label); - - bailout: - xutil_error_wipe(&err); return 0; } diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index 3a122dba6..6c46fb2f6 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -137,7 +137,7 @@ pkg_check_modules(AWESOME_REQUIRED REQUIRED xcb-randr xcb-xtest xcb-xinerama - xcb-event>=0.3.0 + xcb-event>=0.3.4 xcb-aux>=0.3.0 xcb-atom>=0.3.0 xcb-keysyms>=0.3.4