tExit if we cannot grab the root window - glazier - window management experiments
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
(DIR) commit 6c9922fdef83195da197014b486bd6c6e8a0b4df
(DIR) parent be1ea7423a1e2f0c0737f0489ba496cfc073b50b
(HTM) Author: Willy Goiffon <dev@z3bra.org>
Date: Tue, 22 Oct 2019 18:42:08 +0200
Exit if we cannot grab the root window
Diffstat:
M glazier.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/glazier.c b/glazier.c
t@@ -449,6 +449,7 @@ ev_callback(xcb_generic_event_t *ev)
int
main (int argc, char *argv[])
{
+ int mask;
char *argv0;
xcb_generic_event_t *ev = NULL;
t@@ -472,8 +473,14 @@ main (int argc, char *argv[])
curwid = scrn->root;
/* needed to get notified of windows creation */
- wm_reg_event(scrn->root, XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY
- | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT);
+ mask = XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY
+ | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT;
+
+ if (wm_reg_event(scrn->root, mask) < 0) {
+ if (verbose)
+ fprintf(stderr, "Cannot redirect root window event.\n");
+ return -1;
+ }
xcb_flush(conn);
for (;;) {