From 144be3751761d52ad0f132e5476558ae69787c6b Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 28 Jan 2012 10:22:43 +0000 Subject: [PATCH] i3bar: correctly check errors when getting the _XEMBED_INFO property MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes a problem where starting gnome-settings-daemon (maybe other programs, too) would leave an empty spot in i3bar’s tray area. --- i3bar/src/xcb.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index a17812ba..ec633fd5 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -363,17 +363,24 @@ static void handle_client_message(xcb_client_message_event_t* event) { bool map_it = true; int xe_version = 1; xcb_get_property_cookie_t xembedc; - xembedc = xcb_get_property_unchecked(xcb_connection, - 0, - client, - atoms[_XEMBED_INFO], - XCB_GET_PROPERTY_TYPE_ANY, - 0, - 2 * 32); + xcb_generic_error_t *error; + xembedc = xcb_get_property(xcb_connection, + 0, + client, + atoms[_XEMBED_INFO], + XCB_GET_PROPERTY_TYPE_ANY, + 0, + 2 * 32); xcb_get_property_reply_t *xembedr = xcb_get_property_reply(xcb_connection, xembedc, - NULL); + &error); + if (error != NULL) { + ELOG("Error getting _XEMBED_INFO property: error_code %d\n", + error->error_code); + free(error); + return; + } if (xembedr != NULL && xembedr->length != 0) { DLOG("xembed format = %d, len = %d\n", xembedr->format, xembedr->length); uint32_t *xembed = xcb_get_property_value(xembedr); -- 2.39.5