glazier

the original window manipulator
Log | Files | Refs | Submodules | README | LICENSE

commit 6c9922fdef83195da197014b486bd6c6e8a0b4df
parent be1ea7423a1e2f0c0737f0489ba496cfc073b50b
Author: Willy Goiffon <dev@z3bra.org>
Date:   Tue, 22 Oct 2019 18:42:08 +0200

Exit if we cannot grab the root window

Diffstat:
glazier.c | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/glazier.c b/glazier.c @@ -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; @@ -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 (;;) {