aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarstrom <john@ankarstrom.se>2021-07-01 18:50:46 +0200
committerJohn Ankarstrom <john@ankarstrom.se>2021-07-01 18:51:17 +0200
commit45b9e67735752578bafe7d220c0175273847a0f0 (patch)
treeccd9a55db974bd29b5f72e6dc050b0643b3407af
parentd9d02f2db0b6b7df4fc118cebd913ea7cd2f6e1c (diff)
downloaddwim-45b9e67735752578bafe7d220c0175273847a0f0.tar.gz
xchord: Block until event
Otherwise, xchord takes up 100% of the CPU.
-rw-r--r--xchord.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xchord.c b/xchord.c
index 7df852f..59d3f52 100644
--- a/xchord.c
+++ b/xchord.c
@@ -66,6 +66,8 @@ main(int argc, char *argv[])
/* watch for events */
for (;;) {
+ XNextEvent(dpy, &ev);
+ XPutBackEvent(dpy, &ev);
if (!XCheckTypedEvent(dpy, GenericEvent, &ev))
continue;
if (cookie->type != GenericEvent || !XGetEventData(dpy, cookie))