mouse: set maybe_last_handler when consuming event

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.
This commit is contained in:
Kristófer R 2024-11-25 18:47:35 -05:00 committed by Tim Culverhouse
parent 382eb9a52a
commit 9706a14930

View file

@ -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;
}
}