2019-10-02 23:57:25 +02:00
|
|
|
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) {
|
|
|
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
2021-05-28 14:33:56 +02:00
|
|
|
#if PERTAG_PATCH
|
|
|
|
pertagview(&((Arg) { .ui = selmon->tagset[selmon->seltags ^ 1] >> 1 }));
|
|
|
|
#else
|
2019-10-02 23:57:25 +02:00
|
|
|
selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1;
|
2021-05-28 14:33:56 +02:00
|
|
|
#endif // pertagview
|
2019-10-02 23:57:25 +02:00
|
|
|
focus(NULL);
|
|
|
|
arrange(selmon);
|
2021-05-28 14:39:46 +02:00
|
|
|
#if BAR_EWMHTAGS_PATCH
|
|
|
|
updatecurrentdesktop();
|
|
|
|
#endif // BAR_EWMHTAGS_PATCH
|
2019-10-02 23:57:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
viewtoright(const Arg *arg)
|
|
|
|
{
|
|
|
|
if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
|
|
|
&& selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
|
|
|
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
2021-05-28 14:33:56 +02:00
|
|
|
#if PERTAG_PATCH
|
|
|
|
pertagview(&((Arg) { .ui = selmon->tagset[selmon->seltags ^ 1] << 1 }));
|
|
|
|
#else
|
2019-10-02 23:57:25 +02:00
|
|
|
selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1;
|
2021-05-28 14:33:56 +02:00
|
|
|
#endif // pertagview
|
2019-10-02 23:57:25 +02:00
|
|
|
focus(NULL);
|
|
|
|
arrange(selmon);
|
2021-05-28 14:39:46 +02:00
|
|
|
#if BAR_EWMHTAGS_PATCH
|
|
|
|
updatecurrentdesktop();
|
|
|
|
#endif // BAR_EWMHTAGS_PATCH
|
2019-10-02 23:57:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
tagandviewtoleft(const Arg *arg)
|
|
|
|
{
|
2021-10-20 08:59:47 +02:00
|
|
|
if (selmon->sel != NULL
|
|
|
|
&& __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
2019-10-02 23:57:25 +02:00
|
|
|
&& selmon->tagset[selmon->seltags] > 1) {
|
|
|
|
selmon->sel->tags >>= 1;
|
|
|
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
2021-05-28 14:33:56 +02:00
|
|
|
#if PERTAG_PATCH
|
|
|
|
pertagview(&((Arg) { .ui = selmon->tagset[selmon->seltags ^ 1] >> 1 }));
|
|
|
|
#else
|
2019-10-02 23:57:25 +02:00
|
|
|
selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1;
|
2021-05-28 14:33:56 +02:00
|
|
|
#endif // pertagview
|
2019-10-02 23:57:25 +02:00
|
|
|
focus(selmon->sel);
|
|
|
|
arrange(selmon);
|
2021-05-28 14:39:46 +02:00
|
|
|
#if BAR_EWMHTAGS_PATCH
|
|
|
|
updatecurrentdesktop();
|
|
|
|
#endif // BAR_EWMHTAGS_PATCH
|
2019-10-02 23:57:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
tagandviewtoright(const Arg *arg)
|
|
|
|
{
|
2021-10-20 08:59:47 +02:00
|
|
|
if (selmon->sel != NULL
|
|
|
|
&& __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
2019-10-02 23:57:25 +02:00
|
|
|
&& selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
|
|
|
|
selmon->sel->tags <<= 1;
|
|
|
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
2021-05-28 14:33:56 +02:00
|
|
|
#if PERTAG_PATCH
|
|
|
|
pertagview(&((Arg) { .ui = selmon->tagset[selmon->seltags ^ 1] << 1 }));
|
|
|
|
#else
|
2019-10-02 23:57:25 +02:00
|
|
|
selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1;
|
2021-05-28 14:33:56 +02:00
|
|
|
#endif // pertagview
|
2019-10-02 23:57:25 +02:00
|
|
|
focus(selmon->sel);
|
|
|
|
arrange(selmon);
|
2021-05-28 14:39:46 +02:00
|
|
|
#if BAR_EWMHTAGS_PATCH
|
|
|
|
updatecurrentdesktop();
|
|
|
|
#endif // BAR_EWMHTAGS_PATCH
|
2019-10-02 23:57:25 +02:00
|
|
|
}
|
2021-06-14 07:16:17 +02:00
|
|
|
}
|
|
|
|
|