river/src/command/modify_master_count.zig
2020-04-18 13:41:04 +02:00

17 lines
479 B
Zig

const c = @import("../c.zig");
const std = @import("std");
const Arg = @import("../command.zig").Arg;
const Seat = @import("../seat.zig").Seat;
/// Modify the number of master views
pub fn modifyMasterCount(seat: *Seat, arg: Arg) void {
const delta = arg.int;
const output = seat.focused_output;
output.master_count = @intCast(
u32,
std.math.max(0, @intCast(i32, output.master_count) + delta),
);
seat.input_manager.server.root.arrange();
}