diff options
author | Albert Safin <xzfcpw@gmail.com> | 2020-04-08 07:59:51 +0000 |
---|---|---|
committer | Albert Safin <xzfcpw@gmail.com> | 2020-04-08 08:37:40 +0000 |
commit | e03fdef3e5f57eefbd18b6a290b6553dc9f277de (patch) | |
tree | b2064ad25a0ceceee460bfdd798098605c14ae4f | |
parent | 5716ff541ffa8b20c8bd8af8411987dffede9e50 (diff) | |
download | i3-e03fdef3e5f57eefbd18b6a290b6553dc9f277de.tar.gz i3-e03fdef3e5f57eefbd18b6a290b6553dc9f277de.zip |
handlers.c: property_notify(): DLOG and return in case of an error
-rw-r--r-- | src/handlers.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 */ |