summaryrefslogtreecommitdiff
path: root/i3lock.c
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2012-01-05 22:27:01 +0000
committerMichael Stapelberg <michael@stapelberg.de>2012-01-05 22:27:01 +0000
commit34c8108c06a1307fc237f118e12a175bacf7a6f7 (patch)
treeb453372765597319c5ba24b63ea2e5dd637fa4c2 /i3lock.c
parentcab5e6b1dee0cc2ea7021e688fd58513a5a38973 (diff)
Bugfix: Check for waiting X11 events before entering the event loop
Diffstat (limited to 'i3lock.c')
-rw-r--r--i3lock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/i3lock.c b/i3lock.c
index 4c9a807..30922eb 100644
--- 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);
}