dwm-flexipatch/patch/bar_holdbar.c

39 lines
839 B
C
Raw Normal View History

void
holdbar(const Arg *arg)
{
2020-06-30 08:15:36 +00:00
if (selmon->showbar)
return;
2020-07-18 16:59:03 +00:00
Bar *bar;
2020-06-30 08:15:36 +00:00
selmon->showbar = 2;
2020-07-18 16:59:03 +00:00
updatebarpos(selmon);
for (bar = selmon->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
}
void
keyrelease(XEvent *e)
{
2020-07-18 16:59:03 +00:00
Bar *bar;
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;
}
}
2020-06-30 08:15:36 +00:00
if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY) && selmon->showbar == 2) {
selmon->showbar = 0;
2020-07-18 16:59:03 +00:00
updatebarpos(selmon);
for (bar = selmon->bar; bar; bar = bar->next)
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
arrange(selmon);
}
#if COMBO_PATCH
combo = 0;
#endif // COMBO_PATCH
}