From 4f5e22e231a75a3d59acc8b2b458f1ae6879775e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 20 Jan 2019 12:04:29 +0100 Subject: [PATCH] module/xwindow: de-registering events from active window may fail De-registering events from the previous active window may fail (when the previous window has been destroyed). Catch this early, and only log a debug message. This avoids having a normal occurrence polluting the output with error messages. --- modules/xwindow.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/xwindow.c b/modules/xwindow.c index 0579f05..4a968d5 100644 --- a/modules/xwindow.c +++ b/modules/xwindow.c @@ -39,10 +39,18 @@ static void update_active_window(struct private *m) { if (m->active_win != 0) { - xcb_change_window_attributes( + xcb_void_cookie_t c = xcb_change_window_attributes_checked( m->conn, m->active_win, XCB_CW_EVENT_MASK, (const uint32_t []){XCB_EVENT_MASK_NO_EVENT}); + xcb_generic_error_t *e = xcb_request_check(m->conn, c); + if (e != NULL) { + LOG_DBG( + "failed to de-register events on previous active window: %s", + xcb_error(e)); + free(e); + } + m->active_win = 0; }