~rockorager/libvaxis

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] mouse: set maybe_last_handler when consuming event

Details
Message ID
<20241125234735.24927-1-kristofer@thorlaksson.com>
DKIM signature
pass
Download raw message
Patch: +3 -3
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)
Details
Message ID
<D5VO4BFZDJH6.95ZEWPT77UXL@timculverhouse.com>
In-Reply-To
<20241125234735.24927-1-kristofer@thorlaksson.com> (view parent)
DKIM signature
pass
Download raw message
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
Reply to thread Export thread (mbox)