diff --git a/src/main.zig b/src/main.zig index 648c01e..6c9bfe6 100644 --- a/src/main.zig +++ b/src/main.zig @@ -108,12 +108,8 @@ const Buffer = struct { } }; -fn handleActive(win: mfb.Window(State), isActive: bool) callconv(.C) void { - win.getUserData().?.*.active = isActive; - var data = win.getUserData(); - if (data) |value| { - value.*.active = isActive; - } +fn handleActive(win: mfb.Window(State), is_active: bool) callconv(.C) void { + win.getUserData().?.*.active = is_active; } fn handleResize(win: mfb.Window(State), width: i32, height: i32) callconv(.C) void { @@ -147,9 +143,7 @@ fn handleMouseButton(_: mfb.Window(State), mouse_button: mfb.MouseButton, key_mo } fn handleMouseMove(win: mfb.Window(State), x: i32, y: i32) callconv(.C) void { - var state = win.getUserData().?; - std.log.debug("cursor={any}", .{state.*.cursor}); - state.*.cursor = .{ .x = x, .y = y }; + win.getUserData().?.*.cursor = .{ .x = x, .y = y }; } pub fn main() !void {