fix: don't send hover events to dead widgets
This commit is contained in:
parent
f53dc74e9d
commit
26ef53747d
1 changed files with 4 additions and 2 deletions
|
@ -493,6 +493,7 @@ fn send_mouse(self: *Self, y: c_int, x: c_int, from: tp.pid_ref, m: tp.message)
|
|||
} else {
|
||||
if (self.hover_focus) |h| {
|
||||
var buf: [256]u8 = undefined;
|
||||
if (self.is_live_widget_ptr(h))
|
||||
_ = try h.send(tp.self_pid(), tp.message.fmtbuf(&buf, .{ "H", false }) catch |e| return tp.exit_error(e, @errorReturnTrace()));
|
||||
}
|
||||
self.hover_focus = null;
|
||||
|
@ -524,6 +525,7 @@ fn send_mouse_drag(self: *Self, y: c_int, x: c_int, from: tp.pid_ref, m: tp.mess
|
|||
fn clear_hover_focus(self: *Self) tp.result {
|
||||
if (self.hover_focus) |h| {
|
||||
var buf: [256]u8 = undefined;
|
||||
if (self.is_live_widget_ptr(h))
|
||||
_ = try h.send(tp.self_pid(), tp.message.fmtbuf(&buf, .{ "H", false }) catch |e| return tp.exit_error(e, @errorReturnTrace()));
|
||||
}
|
||||
self.hover_focus = null;
|
||||
|
|
Loading…
Add table
Reference in a new issue