Movestack wrap overflow
This commit is contained in:
@@ -3109,17 +3109,22 @@ movestack(const Arg *arg)
|
||||
if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange || sel->isfloating)
|
||||
return;
|
||||
|
||||
int wrap = 0;
|
||||
if (arg->i > 0) {
|
||||
wl_list_for_each(c, &sel->link, link) {
|
||||
if (&c->link == &clients)
|
||||
if (&c->link == &clients) {
|
||||
wrap = 1;
|
||||
continue;
|
||||
}
|
||||
if (VISIBLEON(c, selmon) && !c->isfloating)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
wl_list_for_each_reverse(c, &sel->link, link) {
|
||||
if (&c->link == &clients)
|
||||
if (&c->link == &clients) {
|
||||
wrap = 1;
|
||||
continue;
|
||||
}
|
||||
if (VISIBLEON(c, selmon) && !c->isfloating)
|
||||
break;
|
||||
}
|
||||
@@ -3127,7 +3132,7 @@ movestack(const Arg *arg)
|
||||
if (c == sel)
|
||||
return;
|
||||
wl_list_remove(&sel->link);
|
||||
if (arg->i > 0)
|
||||
if ((arg->i > 0) ^ wrap)
|
||||
wl_list_insert(&c->link, &sel->link);
|
||||
else
|
||||
wl_list_insert(c->link.prev, &sel->link);
|
||||
|
||||
Reference in New Issue
Block a user