From dda56eab373d8abb9cbc59bc4159aa1acd92af73 Mon Sep 17 00:00:00 2001 From: "Mr. Cat" Date: Wed, 18 Mar 2026 20:18:45 +0100 Subject: [PATCH 1/2] Fix compilation error when building without X11 support (#947) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What are the changes about? Add an argument to info log function to fix compiler error. ## What existing issue does this resolve? If building with `zig build -Denable_x11_support=false` there is a compiler error about a missing argument. ``` install └─ install ly └─ compile exe ly Debug native 1 errors src/main.zig:730:27: error: member function expected 3 argument(s), found 2 try state.log_file.info( ~~~~~~~~~~~~~~^~~~~ ly-core/src/LogFile.zig:26:5: note: function declared here pub fn info(self: *LogFile, category: []const u8, comptime message: []const u8, args: anytype) !void { ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ referenced by: callMain [inlined]: /home/oskar/.cache/zig/p/N-V-__8AACFNhBSaulceFT2Wx6Mx-ycGtZh7CEztyVdtX2jW/lib/std/start.zig:627:37 callMainWithArgs [inlined]: /home/oskar/.cache/zig/p/N-V-__8AACFNhBSaulceFT2Wx6Mx-ycGtZh7CEztyVdtX2jW/lib/std/start.zig:587:20 main: /home/oskar/.cache/zig/p/N-V-__8AACFNhBSaulceFT2Wx6Mx-ycGtZh7CEztyVdtX2jW/lib/std/start.zig:602:28 1 reference(s) hidden; use '-freference-trace=4' to see all references ``` ## Pre-requisites - [x] I have tested & confirmed the changes work locally Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/947 Reviewed-by: AnErrupTion Co-authored-by: Mr. Cat Co-committed-by: Mr. Cat --- src/main.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.zig b/src/main.zig index 9d29599..0e261db 100644 --- a/src/main.zig +++ b/src/main.zig @@ -730,6 +730,7 @@ pub fn main() !void { try state.log_file.info( "comp", "x11 support disabled at compile-time", + .{}, ); } From abe72c74ff12c1fe8dc1170efa132c93ed7c7bf3 Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Wed, 18 Mar 2026 20:26:00 +0100 Subject: [PATCH 2/2] Optimise event loop initialisation Signed-off-by: AnErrupTion --- ly-ui/src/TerminalBuffer.zig | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ly-ui/src/TerminalBuffer.zig b/ly-ui/src/TerminalBuffer.zig index 66b915f..b2383af 100644 --- a/ly-ui/src/TerminalBuffer.zig +++ b/ly-ui/src/TerminalBuffer.zig @@ -190,6 +190,8 @@ pub fn runEventLoop( var i: usize = 0; for (layers) |layer| { for (layer) |*widget| { + try widget.update(context); + if (widget.vtable.handle_fn != null) { try self.handlable_widgets.append(allocator, widget); @@ -199,11 +201,6 @@ pub fn runEventLoop( } } - for (layers) |layer| { - for (layer) |*widget| { - try widget.update(context); - } - } try @call(.auto, position_widgets_fn, .{context}); var event: termbox.tb_event = undefined;