[dwm][patch] holdbar: fixed flickering caused by repeated key events

This commit is contained in:
bakkeby 2020-03-29 12:57:07 +02:00
parent 7094852845
commit f2673fec53

View File

@ -20,6 +20,16 @@ holdbar(const Arg *arg)
void void
keyrelease(XEvent *e) 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)) { if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY)) {
selmon->showbar = 0; selmon->showbar = 0;
updateholdbarpos(selmon); updateholdbarpos(selmon);