libwm

library for X windows manipulations
git clone git://z3bra.org/libwm
Log | Files | Refs | LICENSE

commit 65e44403ff65e1c15b76b7be8c20021475d07c1c
parent 246faeb2f14e0be097f3d7629830b469bd6bb7b8
Author: Willy Goiffon <dev@z3bra.org>
Date:   Tue, 22 Oct 2019 19:48:27 +0200

Handle errors in wm_reg_event()

Diffstat:
libwm.c | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/libwm.c b/libwm.c @@ -400,7 +400,15 @@ int wm_reg_event(xcb_window_t wid, uint32_t mask) { uint32_t val[] = { mask }; + xcb_void_cookie_t c; + xcb_generic_error_t *e; - xcb_change_window_attributes(conn, wid, XCB_CW_EVENT_MASK, val); - return 0; + c = xcb_change_window_attributes_checked(conn, wid, XCB_CW_EVENT_MASK, val); + e = xcb_request_check(conn, c); + if (!e) + return 0; + + free(e); + + return 1; }