diff options
author | Julien Danjou <julien@danjou.info> | 2008-09-16 17:41:37 +0200 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2008-09-16 17:41:37 +0200 |
commit | 8efc9b87d1f3e13ed3e198b55ed355a508e0c130 (patch) | |
tree | 26beeb9be80cdbea048e2c159ce429e649d440f2 | |
parent | 044d75cb52066c2808b0cde53fbf7fb695849ce5 (diff) |
icccm: introduce xcb_get_wm_transient_for_from_reply
Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r-- | icccm/icccm.c | 24 | ||||
-rw-r--r-- | icccm/xcb_icccm.h | 9 |
2 files changed, 23 insertions, 10 deletions
diff --git a/icccm/icccm.c b/icccm/icccm.c index 8e7baa5..ed5155f 100644 --- a/icccm/icccm.c +++ b/icccm/icccm.c @@ -280,25 +280,29 @@ xcb_get_wm_transient_for_unchecked(xcb_connection_t *c, xcb_window_t window) } uint8_t -xcb_get_wm_transient_for_reply(xcb_connection_t *c, - xcb_get_property_cookie_t cookie, - xcb_window_t *prop, - xcb_generic_error_t **e) +xcb_get_wm_transient_for_from_reply(xcb_window_t *prop, + xcb_get_property_reply_t *reply) { - xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e); - if(!reply || reply->type != WINDOW || reply->format != 32 || !reply->length) - { - free(reply); return 0; - } *prop = *((xcb_window_t *) xcb_get_property_value(reply)); - free(reply); return 1; } +uint8_t +xcb_get_wm_transient_for_reply(xcb_connection_t *c, + xcb_get_property_cookie_t cookie, + xcb_window_t *prop, + xcb_generic_error_t **e) +{ + xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e); + uint8_t ret = xcb_get_wm_transient_for_from_reply(prop, reply); + free(reply); + return ret; +} + /* WM_SIZE_HINTS */ void diff --git a/icccm/xcb_icccm.h b/icccm/xcb_icccm.h index 3adf259..1514adb 100644 --- a/icccm/xcb_icccm.h +++ b/icccm/xcb_icccm.h @@ -367,6 +367,15 @@ xcb_get_property_cookie_t xcb_get_wm_transient_for_unchecked(xcb_connection_t *c xcb_window_t window); /** + * @brief Fill given window pointer with the WM_TRANSIENT_FOR property of a window. + * @param prop WM_TRANSIENT_FOR property value. + * @param reply The get property request reply. + * @return Return 1 on success, 0 otherwise. + */ +uint8_t +xcb_get_wm_transient_for_from_reply(xcb_window_t *prop, + xcb_get_property_reply_t *reply); +/** * @brief Fill given structure with the WM_TRANSIENT_FOR property of a window. * @param c The connection to the X server. * @param cookie Request cookie. |