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