From 5409b7a330f122b880fd830c127932db10e1bc6b Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 30 Dec 2024 11:57:19 +0100 Subject: ok nice --- dwm.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dwm.c b/dwm.c index a477d6f..bfb7ba2 100644 --- a/dwm.c +++ b/dwm.c @@ -2596,12 +2596,12 @@ void shiftboth(const Arg *arg) { Arg shifted; - shifted.ui = selmon->tagset[selmon->seltags]; + shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK; if (arg->i > 0) /* left circular shift */ - shifted.ui = ((shifted.ui << arg->i) | (shifted.ui >> (LENGTH(tags) - arg->i))); + shifted.ui = ((shifted.ui << arg->i) | (shifted.ui >> (LENGTH(tags) - arg->i))) & ~SPTAGMASK; else /* right circular shift */ - shifted.ui = ((shifted.ui >> (- arg->i) | shifted.ui << (LENGTH(tags) + arg->i))); + shifted.ui = ((shifted.ui >> (- arg->i) | shifted.ui << (LENGTH(tags) + arg->i))) & ~SPTAGMASK; tag(&shifted); view(&shifted); } @@ -2610,12 +2610,15 @@ void shiftview(const Arg *arg) { Arg shifted; - shifted.ui = selmon->tagset[selmon->seltags]; + shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK; - if (arg->i > 0) /* left circular shift */ + if (arg->i > 0) {/* left circular shift */ shifted.ui = (shifted.ui << arg->i) | (shifted.ui >> (LENGTH(tags) - arg->i)); - else /* right circular shift */ + shifted.ui &= ~SPTAGMASK; + } else { /* right circular shift */ shifted.ui = (shifted.ui >> (- arg->i) | shifted.ui << (LENGTH(tags) + arg->i)); + shifted.ui &= ~SPTAGMASK; + } view(&shifted); } -- cgit v1.2.3