Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swap: use correct direction for it_wrap #219

Merged
merged 1 commit into from
Feb 10, 2021
Merged

swap: use correct direction for it_wrap #219

merged 1 commit into from
Feb 10, 2021

Conversation

YerinAlexey
Copy link
Contributor

@YerinAlexey YerinAlexey commented Feb 10, 2021

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

Stack trace from gdb before this fix when trying to swap previous:

attempt to use null value
/home/alex/repos/river/river/command/swap.zig:66:55: 0x21b435 in command.swap.swap (river)
        if (it.next()) |next| next else it_wrap.next().?,
                                                      ^
/home/alex/repos/river/river/command.zig:125:16: 0x24cd7d in command.run (river)
    try impl_fn(allocator, seat, args, out);
               ^
/home/alex/repos/river/river/Control.zig:101:24: 0x239666 in Control.handleRequest (river)
            command.run(util.gpa, seat, args, &out) catch |err| {
                       ^
/home/alex/repos/river/zig-cache/zig-wayland/common.zig:101:76: 0x24d8f1 in .wayland.common.Dispatcher(.wayland.zriver_control_v1_server.ControlV1,*Control).dispatcher (river)
                    @ptrCast(fn (*Obj, Payload, Data) void, implementation)(
                                                                           ^

Thread 1 "river" received signal SIGABRT, Aborted.

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

@ifreund ifreund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@ifreund ifreund merged commit 945b7dc into riverwm:master Feb 10, 2021
@YerinAlexey YerinAlexey deleted the fix-direction branch February 10, 2021 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants