diff options
| author | bakkeby <[email protected]> | 2020-03-29 12:57:07 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-03-29 12:57:07 +0200 |
| commit | f2673fec53bbba86cc5ba2c1ea8ff5f67346f908 (patch) | |
| tree | f36a07a4b3b522d63edbcbbe339f55bf646d6659 | |
| parent | 70948528454b846453817efb946cb1643d6c773f (diff) | |
| download | dwm-flexipatch-f2673fec53bbba86cc5ba2c1ea8ff5f67346f908.tar.gz dwm-flexipatch-f2673fec53bbba86cc5ba2c1ea8ff5f67346f908.zip | |
[dwm][patch] holdbar: fixed flickering caused by repeated key events
| -rw-r--r-- | patch/holdbar.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/patch/holdbar.c b/patch/holdbar.c index a06cab3..8ce543b 100644 --- a/patch/holdbar.c +++ b/patch/holdbar.c @@ -20,6 +20,16 @@ holdbar(const Arg *arg) void keyrelease(XEvent *e) { + if (XEventsQueued(dpy, QueuedAfterReading)) { + XEvent ne; + XPeekEvent(dpy, &ne); + + if (ne.type == KeyPress && ne.xkey.time == e->xkey.time && + ne.xkey.keycode == e->xkey.keycode) { + XNextEvent(dpy, &ne); + return; + } + } if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY)) { selmon->showbar = 0; updateholdbarpos(selmon); |
