You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dwm-flexipatch/patch/focusadjacenttag.c

64 lines
1.5 KiB
C

void
tagtoleft(const Arg *arg)
{
if (selmon->sel != NULL
&& __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
&& selmon->tagset[selmon->seltags] > 1) {
selmon->sel->tags >>= 1;
focus(NULL);
arrange(selmon);
}
}
void
tagtoright(const Arg *arg)
{
if (selmon->sel != NULL
&& __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
&& selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
selmon->sel->tags <<= 1;
focus(NULL);
arrange(selmon);
}
}
void
viewtoleft(const Arg *arg)
{
if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
&& selmon->tagset[selmon->seltags] > 1) {
view(&((Arg) { .ui = selmon->tagset[selmon->seltags] >> 1 }));
}
}
void
viewtoright(const Arg *arg)
{
if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
&& selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
view(&((Arg) { .ui = selmon->tagset[selmon->seltags] << 1 }));
}
}
void
tagandviewtoleft(const Arg *arg)
{
if (selmon->sel != NULL
&& __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
&& selmon->tagset[selmon->seltags] > 1) {
selmon->sel->tags >>= 1;
view(&((Arg) { .ui = selmon->tagset[selmon->seltags] >> 1 }));
}
}
void
tagandviewtoright(const Arg *arg)
{
if (selmon->sel != NULL
&& __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
&& selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
selmon->sel->tags <<= 1;
view(&((Arg) { .ui = selmon->tagset[selmon->seltags] << 1 }));
}
}