aboutsummaryrefslogtreecommitdiff
path: root/src/command/modify_master_count.zig
blob: 6c64091fa6c07fe50ba4a99a45c06d6f523a625d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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();
}