awesome: use xcb_event error code
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
cda33ca3e6
commit
d834e19a23
35
awesome.c
35
awesome.c
|
@ -273,33 +273,20 @@ xerror(void *data __attribute__ ((unused)),
|
||||||
xcb_connection_t *c __attribute__ ((unused)),
|
xcb_connection_t *c __attribute__ ((unused)),
|
||||||
xcb_generic_error_t *e)
|
xcb_generic_error_t *e)
|
||||||
{
|
{
|
||||||
xutil_error_t err;
|
/* ignore this */
|
||||||
|
if(e->error_code == XCB_EVENT_ERROR_BAD_WINDOW
|
||||||
if(!xutil_error_init(e, &err))
|
|| (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;
|
return 0;
|
||||||
|
|
||||||
/* ignore this */
|
warn("X error: request=%s, error=%s",
|
||||||
if(e->error_code == XUTIL_BAD_WINDOW
|
xcb_event_get_request_label(XCB_EVENT_REQUEST_TYPE(e)),
|
||||||
|| (e->error_code == XUTIL_BAD_MATCH && err.request_code == XCB_SET_INPUT_FOCUS)
|
xcb_event_get_error_label(e->error_code));
|
||||||
|| (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", 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ pkg_check_modules(AWESOME_REQUIRED REQUIRED
|
||||||
xcb-randr
|
xcb-randr
|
||||||
xcb-xtest
|
xcb-xtest
|
||||||
xcb-xinerama
|
xcb-xinerama
|
||||||
xcb-event>=0.3.0
|
xcb-event>=0.3.4
|
||||||
xcb-aux>=0.3.0
|
xcb-aux>=0.3.0
|
||||||
xcb-atom>=0.3.0
|
xcb-atom>=0.3.0
|
||||||
xcb-keysyms>=0.3.4
|
xcb-keysyms>=0.3.4
|
||||||
|
|
Loading…
Reference in New Issue