fix: don't dispatch mouse and widget events to keyboard_focus widget
This commit is contained in:
parent
7d51b09aac
commit
aff2a7919b
1 changed files with 1 additions and 10 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue