]> git.sur5r.net Git - i3/i3/commitdiff
i3bar: Bugfix: avoid freeze after VisibilityNotify 2863/head
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 20 Aug 2017 10:14:12 +0000 (12:14 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 20 Aug 2017 10:16:43 +0000 (12:16 +0200)
fixes #2790

i3bar/src/xcb.c

index 3bd5677ab22cd7049d4e16f51eff7b456ec645ad..2ba446b1176be8596d34d2b3b7c6e19287dcd19a 100644 (file)
@@ -1255,6 +1255,12 @@ char *init_xcb_early() {
     ev_prepare_init(xcb_prep, &xcb_prep_cb);
     ev_check_init(xcb_chk, &xcb_chk_cb);
 
+    /* Within an event loop iteration, run the xcb_chk watcher last: other
+     * watchers might call xcb_flush(), which, unexpectedly, can also read
+     * events into the queue (see _xcb_conn_wait). Hence, we need to drain xcb’s
+     * queue last, otherwise we risk dead-locking. */
+    ev_set_priority(xcb_chk, EV_MINPRI);
+
     ev_io_start(main_loop, xcb_io);
     ev_prepare_start(main_loop, xcb_prep);
     ev_check_start(main_loop, xcb_chk);