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:
parent
7045b21534
commit
5f4d80f313
2 changed files with 16 additions and 8 deletions
|
|
@ -205,8 +205,13 @@ fn riverOutputListener(river_output_v1: *river.OutputV1, event: river.OutputV1.E
|
||||||
if (seat.focused_output != output) break :blk;
|
if (seat.focused_output != output) break :blk;
|
||||||
|
|
||||||
const next_output = wm.nextOutput(output);
|
const next_output = wm.nextOutput(output);
|
||||||
if (next_output == output) break :blk;
|
if (next_output == output or next_output == null) {
|
||||||
const o = next_output orelse break :blk;
|
// This was the last output; clear focus
|
||||||
|
seat.pending_manage.output = .clear_focus;
|
||||||
|
seat.pending_manage.window = .clear_focus;
|
||||||
|
break :blk;
|
||||||
|
}
|
||||||
|
const o = next_output.?;
|
||||||
|
|
||||||
seat.pending_manage.output = .{ .output = o };
|
seat.pending_manage.output = .{ .output = o };
|
||||||
if (o.windows.first()) |window| {
|
if (o.windows.first()) |window| {
|
||||||
|
|
|
||||||
|
|
@ -333,6 +333,8 @@ const XkbBinding = struct {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (pending_output) |output| {
|
if (pending_output) |output| {
|
||||||
|
// 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
|
// We have to remove window from current output's windows list first
|
||||||
window.link.remove();
|
window.link.remove();
|
||||||
output.windows.append(window);
|
output.windows.append(window);
|
||||||
|
|
@ -342,6 +344,7 @@ const XkbBinding = struct {
|
||||||
window.pending_manage.pending_output = .{ .output = output };
|
window.pending_manage.pending_output = .{ .output = output };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn moveFloatingWindow(context: *Context, dx: i32, dy: i32) void {
|
fn moveFloatingWindow(context: *Context, dx: i32, dy: i32) void {
|
||||||
const seat = context.wm.seats.first() orelse return;
|
const seat = context.wm.seats.first() orelse return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue