From 452b89d6ec149ba3ebd7f0e042d8b7ee0379573a Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine Date: Sat, 21 Jun 2008 19:56:51 +0900 Subject: [PATCH] Always use unchecked xcb functions --- common/draw.c | 14 +++++++------- common/xembed.c | 4 +++- common/xutil.c | 6 +++--- event.c | 8 ++++---- placement.c | 5 +++-- systray.c | 2 +- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/common/draw.c b/common/draw.c index 74021d20..df35f64a 100644 --- a/common/draw.c +++ b/common/draw.c @@ -1111,9 +1111,9 @@ xcolor_new(xcb_connection_t *conn, int phys_screen, const char *colstr, xcolor_t blue = RGB_COLOR_8_TO_16(colnum); hexa_color = xcb_alloc_color_reply(conn, - xcb_alloc_color(conn, - s->default_colormap, - red, green, blue), + xcb_alloc_color_unchecked(conn, + s->default_colormap, + red, green, blue), NULL); if(hexa_color) @@ -1130,10 +1130,10 @@ xcolor_new(xcb_connection_t *conn, int phys_screen, const char *colstr, xcolor_t else { named_color = xcb_alloc_named_color_reply(conn, - xcb_alloc_named_color(conn, - s->default_colormap, - len, - colstr), + xcb_alloc_named_color_unchecked(conn, + s->default_colormap, + len, + colstr), NULL); if(named_color) diff --git a/common/xembed.c b/common/xembed.c index 74e9de03..303434aa 100644 --- a/common/xembed.c +++ b/common/xembed.c @@ -95,7 +95,9 @@ xembed_info_get(xcb_connection_t *connection, xcb_window_t win, xembed_info_t *i atom_q = xutil_intern_atom(connection, NULL, "_XEMBED_INFO"); atom = xutil_intern_atom_reply(connection, NULL, atom_q); - prop_c = xcb_get_property(connection, false, win, atom, XCB_GET_PROPERTY_TYPE_ANY, 0L, 2); + prop_c = xcb_get_property_unchecked(connection, false, win, atom, + XCB_GET_PROPERTY_TYPE_ANY, 0L, 2); + prop_r = xcb_get_property_reply(connection, prop_c, NULL); if(!prop_r || !prop_r->value_len) diff --git a/common/xutil.c b/common/xutil.c index ef168529..8d1d336c 100644 --- a/common/xutil.c +++ b/common/xutil.c @@ -137,9 +137,9 @@ xutil_get_transient_for_hint(xcb_connection_t *c, xcb_window_t win, /* Use checked because the error handler should not take care of * this error as we only return a boolean */ t_hint_r = xcb_get_property_reply(c, - xcb_get_property(c, false, win, - WM_TRANSIENT_FOR, - WINDOW, 0, 1), + xcb_get_property_unchecked(c, false, win, + WM_TRANSIENT_FOR, + WINDOW, 0, 1), NULL); if(!t_hint_r || t_hint_r->type != WINDOW || t_hint_r->format != 32 || diff --git a/event.c b/event.c index d1e8bb16..f9d65040 100644 --- a/event.c +++ b/event.c @@ -440,7 +440,7 @@ event_handle_maprequest(void *data __attribute__ ((unused)), xcb_get_geometry_reply_t *geom_r; xcb_screen_iterator_t iter; - wa_c = xcb_get_window_attributes(connection, ev->window); + wa_c = xcb_get_window_attributes_unchecked(connection, ev->window); if(!(wa_r = xcb_get_window_attributes_reply(connection, wa_c, NULL))) return -1; @@ -455,11 +455,11 @@ event_handle_maprequest(void *data __attribute__ ((unused)), } else if(!(c = client_getbywin(ev->window))) { - geom_c = xcb_get_geometry(connection, ev->window); + geom_c = xcb_get_geometry_unchecked(connection, ev->window); if(globalconf.screens_info->xinerama_is_active) - qp_c = xcb_query_pointer(connection, xutil_screen_get(globalconf.connection, - screen_nbr)->root); + qp_c = xcb_query_pointer_unchecked(connection, xutil_screen_get(globalconf.connection, + screen_nbr)->root); if(!(geom_r = xcb_get_geometry_reply(connection, geom_c, NULL))) { diff --git a/placement.c b/placement.c index b702fdbc..2800ba2e 100644 --- a/placement.c +++ b/placement.c @@ -134,8 +134,9 @@ placement_under_mouse(client_t *c) xcb_query_pointer_reply_t *qp_r; area_t finalgeometry = c->f_geometry; - qp_c = xcb_query_pointer(globalconf.connection, - xutil_screen_get(globalconf.connection, c->phys_screen)->root); + qp_c = xcb_query_pointer_unchecked(globalconf.connection, + xutil_screen_get(globalconf.connection, + c->phys_screen)->root); if((qp_r = xcb_query_pointer_reply(globalconf.connection, qp_c, NULL))) { finalgeometry.x = qp_r->root_x - c->f_geometry.width / 2; diff --git a/systray.c b/systray.c index dae9250a..b0eda60b 100644 --- a/systray.c +++ b/systray.c @@ -138,7 +138,7 @@ systray_process_client_message(xcb_client_message_event_t *ev) switch(ev->data.data32[1]) { case SYSTEM_TRAY_REQUEST_DOCK: - geom_c = xcb_get_geometry(globalconf.connection, ev->window); + geom_c = xcb_get_geometry_unchecked(globalconf.connection, ev->window); if(!(geom_r = xcb_get_geometry_reply(globalconf.connection, geom_c, NULL))) return -1;