fix: don't dispatch mouse and widget events to keyboard_focus widget

This commit is contained in:
CJ van den Berg 2026-02-25 10:58:17 +01:00
parent 7d51b09aac
commit aff2a7919b
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -875,9 +875,7 @@ fn send_widgets(self: *Self, from: tp.pid_ref, m: tp.message) error{Exit}!bool {
const frame = tracy.initZone(@src(), .{ .name = "tui widgets" });
defer frame.deinit();
tp.trace(tp.channel.widget, m);
return if (self.keyboard_focus) |w|
w.send(from, m)
else if (self.mainview_) |mv|
return if (self.mainview_) |mv|
mv.send(from, m)
else
false;
@ -886,9 +884,6 @@ fn send_widgets(self: *Self, from: tp.pid_ref, m: tp.message) error{Exit}!bool {
fn send_mouse(self: *Self, y: c_int, x: c_int, from: tp.pid_ref, m: tp.message) tp.result {
tp.trace(tp.channel.input, m);
_ = self.input_listeners_.send(from, m) catch {};
if (self.keyboard_focus) |w|
if (try w.send(from, m))
return;
if (try self.update_hover(y, x)) |w|
_ = try w.send(from, m);
}
@ -896,10 +891,6 @@ fn send_mouse(self: *Self, y: c_int, x: c_int, from: tp.pid_ref, m: tp.message)
fn send_mouse_drag(self: *Self, y: c_int, x: c_int, from: tp.pid_ref, m: tp.message) tp.result {
tp.trace(tp.channel.input, m);
_ = self.input_listeners_.send(from, m) catch {};
if (self.keyboard_focus) |w| {
if (try w.send(from, m))
return;
}
_ = try self.update_hover(y, x);
if (self.drag_source) |w| _ = try w.send(from, m);
}