fix(tui): reset drag context when invalidating the widget tree

This prevents a segfault if dragging and navigating at the same time.
This commit is contained in:
CJ van den Berg 2024-06-20 22:21:49 +02:00
parent ce9c5ea23d
commit 3ea039f41c
2 changed files with 8 additions and 0 deletions

View file

@ -664,6 +664,11 @@ pub fn get_mode() []const u8 {
return if (current().input_mode) |m| m.name else "INI";
}
pub fn reset_drag_context() void {
const self = current();
self.drag_source = null;
}
pub fn need_render() void {
const self = current();
if (!(self.render_pending or self.frame_clock_running)) {