dwm/patch/combo.c

40 lines
642 B
C
Raw Normal View History

2019-09-11 23:35:43 +02:00
static int combo = 0;
#if !BAR_HOLDBAR_PATCH
2019-09-11 23:35:43 +02:00
void
keyrelease(XEvent *e)
{
2019-09-11 23:35:43 +02:00
combo = 0;
}
#endif // !BAR_HOLDBAR_PATCH
2019-09-11 23:35:43 +02:00
void
combotag(const Arg *arg)
{
if (selmon->sel && arg->ui & TAGMASK) {
#if SWITCHTAG_PATCH
if (selmon->sel->switchtag)
selmon->sel->switchtag = 0;
#endif // SWITCHTAG_PATCH
2019-09-11 23:35:43 +02:00
if (combo) {
selmon->sel->tags |= arg->ui & TAGMASK;
} else {
combo = 1;
selmon->sel->tags = arg->ui & TAGMASK;
}
focus(NULL);
arrange(selmon);
}
}
void
comboview(const Arg *arg)
{
2019-09-11 23:35:43 +02:00
if (combo) {
view(&((Arg) { .ui = selmon->tagset[selmon->seltags] | (arg->ui & TAGMASK) }));
2019-09-11 23:35:43 +02:00
} else {
combo = 1;
view(arg);
2019-09-11 23:35:43 +02:00
}
}