summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-03-29 12:57:07 +0200
committerbakkeby <[email protected]>2020-03-29 12:57:07 +0200
commitf2673fec53bbba86cc5ba2c1ea8ff5f67346f908 (patch)
treef36a07a4b3b522d63edbcbbe339f55bf646d6659 /patch
parent70948528454b846453817efb946cb1643d6c773f (diff)
downloaddwm-flexipatch-f2673fec53bbba86cc5ba2c1ea8ff5f67346f908.tar.gz
dwm-flexipatch-f2673fec53bbba86cc5ba2c1ea8ff5f67346f908.zip
[dwm][patch] holdbar: fixed flickering caused by repeated key events
Diffstat (limited to 'patch')
-rw-r--r--patch/holdbar.c10
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);