From e03fdef3e5f57eefbd18b6a290b6553dc9f277de Mon Sep 17 00:00:00 2001 From: Albert Safin Date: Wed, 8 Apr 2020 07:59:51 +0000 Subject: handlers.c: property_notify(): DLOG and return in case of an error --- src/handlers.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/handlers.c b/src/handlers.c index 1108b383..5176e7c1 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -1265,6 +1265,7 @@ void property_handlers_init(void) { static void property_notify(uint8_t state, xcb_window_t window, xcb_atom_t atom) { struct property_handler_t *handler = NULL; xcb_get_property_reply_t *propr = NULL; + xcb_generic_error_t *err = NULL; for (size_t c = 0; c < NUM_HANDLERS; c++) { if (property_handlers[c].atom != atom) @@ -1281,7 +1282,12 @@ static void property_notify(uint8_t state, xcb_window_t window, xcb_atom_t atom) if (state != XCB_PROPERTY_DELETE) { xcb_get_property_cookie_t cookie = xcb_get_property(conn, 0, window, atom, XCB_GET_PROPERTY_TYPE_ANY, 0, handler->long_len); - propr = xcb_get_property_reply(conn, cookie, 0); + propr = xcb_get_property_reply(conn, cookie, &err); + if (err != NULL) { + DLOG("got error %d when getting property of atom %d\n", err->error_code, atom); + FREE(err); + return; + } } /* the handler will free() the reply unless it returns false */ -- cgit v1.2.3-54-g00ecf