From 1cf22db4987c8c89e1668d87ddf183bd1d3fa52a Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 23 Feb 2026 21:51:05 +0100 Subject: [PATCH] fix: reset hover on focus_out events --- src/tui/tui.zig | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/tui/tui.zig b/src/tui/tui.zig index 408ff07..fa425da 100644 --- a/src/tui/tui.zig +++ b/src/tui/tui.zig @@ -517,11 +517,18 @@ fn receive_safe(self: *Self, from: tp.pid_ref, m: tp.message) !void { if (try self.send_widgets(from, m)) return; - if (try m.match(.{"focus_in"})) + if (try m.match(.{"focus_in"})) { + std.log.debug("focus_in", .{}); return; + } - if (try m.match(.{"focus_out"})) + if (try m.match(.{"focus_out"})) { + std.log.debug("focus_out", .{}); + self.clear_hover_focus(@src()) catch {}; + self.last_hover_x = -1; + self.last_hover_y = -1; return; + } if (try m.match(.{ "exit", tp.more })) { if (try m.match(.{ tp.string, "normal" }) or