]> git.sur5r.net Git - i3/i3lock/commitdiff
Bugfix: Check for waiting X11 events before entering the event loop
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 5 Jan 2012 22:27:01 +0000 (22:27 +0000)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 5 Jan 2012 22:27:01 +0000 (22:27 +0000)
i3lock.c

index 4c9a8071bf12ad1b4d5c03791cdcaa3c12294618..30922eb572399471023351d55a11cf5ded36541c 100644 (file)
--- a/i3lock.c
+++ b/i3lock.c
@@ -689,6 +689,9 @@ int main(int argc, char *argv[]) {
     ev_prepare_init(xcb_prepare, xcb_prepare_cb);
     ev_prepare_start(main_loop, xcb_prepare);
 
-    xcb_flush(conn);
+    /* Invoke the event callback once to catch all the events which were
+     * received up until now. ev will only pick up new events (when the X11
+     * file descriptor becomes readable). */
+    ev_invoke(main_loop, xcb_check, 0);
     ev_loop(main_loop, 0);
 }