fix: reset hover on focus_out events

This commit is contained in:
CJ van den Berg 2026-02-23 21:51:05 +01:00
parent 4cbd8fbde3
commit 1cf22db498
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -517,11 +517,18 @@ fn receive_safe(self: *Self, from: tp.pid_ref, m: tp.message) !void {
if (try self.send_widgets(from, m)) if (try self.send_widgets(from, m))
return; return;
if (try m.match(.{"focus_in"})) if (try m.match(.{"focus_in"})) {
std.log.debug("focus_in", .{});
return; 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; return;
}
if (try m.match(.{ "exit", tp.more })) { if (try m.match(.{ "exit", tp.more })) {
if (try m.match(.{ tp.string, "normal" }) or if (try m.match(.{ tp.string, "normal" }) or