Follow-up to my previous patch; this fixes an issue where the mouse_leave
event was never sent because maybe_last_handler was only set when there
was already a maybe_last_handler widget set.
The change here makes it so that every time an event is consumed libvaxis
keeps track of which widget did that through the maybe_last_handler
variable.
In other words: we update maybe_last_handler every time an event is
explcitly consumed.
---
src/vxfw/App.zig | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/vxfw/App.zig b/src/vxfw/App.zig
index b4408b7..797e49d 100644
--- a/src/vxfw/App.zig
+++ b/src/vxfw/App.zig
@@ -272,8 +272,8 @@ const MouseHandler = struct {
self.maybe_last_handler = item.widget;
try app.handleCommand(&ctx.cmds);
}
- self.maybe_last_handler = item.widget;
}
+ self.maybe_last_handler = item.widget;
return;
}
}
@@ -294,8 +294,8 @@ const MouseHandler = struct {
self.maybe_last_handler = target.widget;
try app.handleCommand(&ctx.cmds);
}
- self.maybe_last_handler = target.widget;
}
+ self.maybe_last_handler = target.widget;
return;
}
}
@@ -317,8 +317,8 @@ const MouseHandler = struct {
self.maybe_last_handler = item.widget;
try app.handleCommand(&ctx.cmds);
}
- self.maybe_last_handler = item.widget;
}
+ self.maybe_last_handler = item.widget;
return;
}
}
--
2.39.5 (Apple Git-154)
On Mon Nov 25, 2024 at 5:47 PM CST, Kristófer R wrote:
> Follow-up to my previous patch; this fixes an issue where the mouse_leave
> event was never sent because maybe_last_handler was only set when there
> was already a maybe_last_handler widget set.
>
> The change here makes it so that every time an event is consumed libvaxis
> keeps track of which widget did that through the maybe_last_handler
> variable.
>
> In other words: we update maybe_last_handler every time an event is
> explcitly consumed.
> ---
Applied on main, thanks!
--
Tim