Fix a number of typos in comments

This commit is contained in:
Ben Buhse 2026-02-22 17:51:17 -06:00
commit b9d13583ab
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
10 changed files with 24 additions and 17 deletions

View file

@ -10,7 +10,7 @@ const BufferPool = @This();
/// Note that we can absolutely work with higher buffer numbers if needed, /// Note that we can absolutely work with higher buffer numbers if needed,
/// however we consider that to be an anomaly and therefore do not want to /// however we consider that to be an anomaly and therefore do not want to
/// keep all those extra buffers around if we can avoid it, as to not have /// keep all those extra buffers around if we can avoid it, as to not have
/// unecessary memory overhead. /// unnecessary memory overhead.
const max_buffer_multiplicity = 3; const max_buffer_multiplicity = 3;
/// The buffers. This is a linked list and not an array list, because we /// The buffers. This is a linked list and not an array list, because we

View file

@ -38,6 +38,19 @@ pub fn create(context: *Context, river_input_manager_v1: *river.InputManagerV1,
} }
pub fn destroy(im: *InputManager) void { pub fn destroy(im: *InputManager) void {
{
var it = im.input_devices.iterator(.forward);
while (it.next()) |input_device| {
input_device.destroy();
}
}
{
var it = im.libinput_devices.iterator(.forward);
while (it.next()) |libinput_device| {
libinput_device.destroy();
}
}
im.river_input_manager_v1.destroy(); im.river_input_manager_v1.destroy();
im.river_libinput_config_v1.destroy(); im.river_libinput_config_v1.destroy();
utils.gpa.destroy(im); utils.gpa.destroy(im);

View file

@ -334,4 +334,4 @@ const utils = @import("utils.zig");
const Context = @import("Context.zig"); const Context = @import("Context.zig");
const InputDevice = @import("InputDevice.zig"); const InputDevice = @import("InputDevice.zig");
const log = std.log.scoped(.InputDevice); const log = std.log.scoped(.LibinputDevice);

View file

@ -32,7 +32,6 @@ surfaces: ?struct {
layer_surface: *zwlr.LayerSurfaceV1, layer_surface: *zwlr.LayerSurfaceV1,
} = null, } = null,
// TODO: Make Bar a user option, can disable if they want
bar: ?Bar, bar: ?Bar,
tag_overlay: ?TagOverlay, tag_overlay: ?TagOverlay,
@ -439,8 +438,8 @@ fn calculateScale(image_dimension: c_int, output_dimension: u31, scale: u31) f64
fn calculateTransform(image_dimension: c_int, output_dimension: u31, dimension_scale: f64) f64 { fn calculateTransform(image_dimension: c_int, output_dimension: u31, dimension_scale: f64) f64 {
const numerator1: f64 = @floatFromInt(image_dimension); const numerator1: f64 = @floatFromInt(image_dimension);
const denominator1: f64 = dimension_scale; const denominator1: f64 = dimension_scale;
const subtruend: f64 = @floatFromInt(output_dimension); const subtrahend: f64 = @floatFromInt(output_dimension);
const numerator2: f64 = numerator1 / denominator1 - subtruend; const numerator2: f64 = numerator1 / denominator1 - subtrahend;
return numerator2 / 2 / dimension_scale; return numerator2 / 2 / dimension_scale;
} }
@ -565,7 +564,7 @@ pub fn manage(output: *Output) void {
// Show tag overlay and arm the hide timer // Show tag overlay and arm the hide timer
if (output.tag_overlay) |*tag_overlay| { if (output.tag_overlay) |*tag_overlay| {
if (tag_overlay.surfaces) |_| { if (tag_overlay.surfaces) |_| {
// The overlay is arleady visible, but we still need to re-render // The overlay is already visible, but we still need to re-render
tag_overlay.render() catch |err| { tag_overlay.render() catch |err| {
log.err("tag_overlay render failed: {}", .{err}); log.err("tag_overlay render failed: {}", .{err});
}; };

View file

@ -33,7 +33,7 @@ pending_manage: PendingManage = .{},
/// State consumed in render() phase, reset at end of render(). /// State consumed in render() phase, reset at end of render().
pending_render: PendingRender = .{}, pending_render: PendingRender = .{},
/// Used to put Windows into a list in calculatePrimaryStackLayout() /// Used to put Windows into a list when calculating the layout
active_list_node: DoublyLinkedList.Node = .{}, active_list_node: DoublyLinkedList.Node = .{},
link: wl.list.Link, link: wl.list.Link,
@ -298,7 +298,7 @@ pub fn manage(window: *Window) void {
window.floating_rect.y = window.rect.y; window.floating_rect.y = window.rect.y;
} }
} }
// Layout (pre-computed by WindowManager.caluclateLayout()) // Layout (pre-computed by WindowManager
if (pending_manage.dimensions) |dimensions| { if (pending_manage.dimensions) |dimensions| {
window.rect.width = dimensions.width; window.rect.width = dimensions.width;
window.rect.height = dimensions.height; window.rect.height = dimensions.height;

View file

@ -83,8 +83,8 @@ pub fn prevOutput(wm: *WindowManager, current: *Output) ?*Output {
fn initialize(wm: *WindowManager) void { fn initialize(wm: *WindowManager) void {
if (wm.context.initialized) return; if (wm.context.initialized) return;
// We need a seat to intitialize this stuff, so let's just not do it right now. // We need a seat to initialize this stuff, so let's just not do it right now.
// The WM can run fine without it, though, it won't be fully usuable. // The WM can run fine without it, though, it won't be fully usable.
const seat = wm.seats.first() orelse return; const seat = wm.seats.first() orelse return;
const river_seat_v1 = seat.river_seat_v1; const river_seat_v1 = seat.river_seat_v1;

View file

@ -110,7 +110,7 @@ pub fn load(config: *Config, parser: *kdl.Parser, name: ?[]const u8, hostname: ?
.dwtp, .dwtp,
=> |cmd| { => |cmd| {
// These all have arguments, but we can use compile time constructs to reduce // These all have arguments, but we can use compile time constructs to reduce
// code re-use here. // code reuse here.
// Because all the fields are optional, we have to use @typeInfo and get the optional's child type. // Because all the fields are optional, we have to use @typeInfo and get the optional's child type.
const field_name = @tagName(cmd); const field_name = @tagName(cmd);
const FieldType = @typeInfo(@TypeOf(@field(input_config, field_name))).optional.child; const FieldType = @typeInfo(@TypeOf(@field(input_config, field_name))).optional.child;

View file

@ -95,7 +95,7 @@ pub fn load(config: *Config, parser: *kdl.Parser, hostname: ?[]const u8) !void {
const command: XkbBindings.Command = sw: switch (name) { const command: XkbBindings.Command = sw: switch (name) {
.spawn => { .spawn => {
// TODO: Add propert(ies) to support ENV vars // TODO: Add properties to support ENV vars
const exec_str = utils.stripQuotes(node.arg(parser, 2) orelse { const exec_str = utils.stripQuotes(node.arg(parser, 2) orelse {
logWarnMissingNodeArg(name, "command"); logWarnMissingNodeArg(name, "command");
continue; continue;

View file

@ -90,9 +90,6 @@ pub fn main() !void {
try run(wl_display, context); try run(wl_display, context);
} }
/// Function to handle the main event loop
///
/// Since we've added a bar with a clock,we need
fn run(wl_display: *wl.Display, context: *Context) !void { fn run(wl_display: *wl.Display, context: *Context) !void {
var mask = posix.sigemptyset(); var mask = posix.sigemptyset();

View file

@ -186,8 +186,6 @@ const wayland = @import("wayland");
const river = wayland.client.river; const river = wayland.client.river;
const pixman = @import("pixman"); const pixman = @import("pixman");
const utils = @import("utils.zig");
const log = std.log.scoped(.utils); const log = std.log.scoped(.utils);
const testing = std.testing; const testing = std.testing;