git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commite89060ffd573afd8da0fc65d10f5e749da27a3b2
parent707a988caa
authorAlexey Yerin <[email protected]>
date2021-02-10 11:31
swap: use correct direction for it_wrap

Always using .forward results in a crash when running `swap previous` on
the first view in stack which should be wrapped.

 river/command/swap.zig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/river/command/swap.zig b/river/command/swap.zig
index ac2f1a8..2c138fe 100644
--- a/river/command/swap.zig
+++ b/river/command/swap.zig
@@ -51,7 +51,7 @@ pub fn swap(
     );
     var it_wrap = ViewStack(View).iter(
         if (direction == .next) output.views.first else output.views.last,
-        .forward,
+        if (direction == .next) .forward else .reverse,
         output.pending.tags,
         filter,
     );