~rockorager/libvaxis

mouse: set maybe_last_handler when consuming event v1 PROPOSED

Kristófer R: 1
 mouse: set maybe_last_handler when consuming event

 1 files changed, 3 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rockorager/libvaxis/patches/56111/mbox | git am -3
Learn more about email & git

[PATCH] mouse: set maybe_last_handler when consuming event Export this patch

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)