Fix sendTo{Prev,Next}Output commands

Before, they would try send the window to the "next" output even if
there was only one output... which really just means sending the window
to the bottom of the stack. Instead, they should be a noop.

Also fixed a bug when removing all outputs where the seat wouldn't
clear its focused output.
This commit is contained in:
Ben Buhse 2026-02-19 14:01:51 -06:00
commit 5f4d80f313
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
2 changed files with 16 additions and 8 deletions

View file

@ -333,13 +333,16 @@ const XkbBinding = struct {
};
if (pending_output) |output| {
// We have to remove window from current output's windows list first
window.link.remove();
output.windows.append(window);
// This should be a noop if there's only one output
if (output != window.output) {
// We have to remove window from current output's windows list first
window.link.remove();
output.windows.append(window);
seat.pending_manage.output = .{ .output = output };
seat.pending_manage.should_warp_pointer = true;
window.pending_manage.pending_output = .{ .output = output };
seat.pending_manage.output = .{ .output = output };
seat.pending_manage.should_warp_pointer = true;
window.pending_manage.pending_output = .{ .output = output };
}
}
}