applied rotatetags patch

This commit is contained in:
λmolinae 2025-01-31 00:38:11 -06:00
parent 93642f22d0
commit 4b8630fee4
4 changed files with 53 additions and 1 deletions

29
dwl.c
View file

@ -414,6 +414,7 @@ static Monitor *xytomon(double x, double y);
static void xytonode(double x, double y, struct wlr_surface **psurface,
Client **pc, LayerSurface **pl, double *nx, double *ny);
static void zoom(const Arg *arg);
static void rotatetags(const Arg *arg);
/* variables */
static pid_t child_pid = -1;
@ -3594,6 +3595,34 @@ zoom(const Arg *arg)
arrange(selmon);
}
static void
rotatetags(const Arg *arg)
{
Arg newarg;
int i = arg->i;
int nextseltags = 0, curseltags = selmon->tagset[selmon->seltags];
bool shift = false;
switch(abs(i)) {
default: break;
case SHIFT_R:
shift = true;
break;
};
if (i > 0)
nextseltags = (curseltags << 1) | (curseltags >> (LENGTH(tags) - 1));
else
nextseltags = (curseltags >> 1) | (curseltags << (LENGTH(tags) - 1));
newarg.i = nextseltags;
if (shift)
tag(&newarg);
else
view(&newarg);
}
#ifdef XWAYLAND
void
activatex11(struct wl_listener *listener, void *data)