Widget::mouse_interaction isn't being called as frequently as expected

I’m building a widget using the master branch of Iced, and for some reason mouse_interaction isn’t getting called as expected.

With a bit of print debugging, I can see that Widget::update is called whenever any event in my GUI fires. So far, so good. However, Widget::mouse_interaction is only called when either: the widget in question handles an event (just a simple click event, in this case) or when some other widget in the GUI handles an interaction.

I can “fix” this by placing shell::invalidate_widgets() at the top of my Widget::update method, but that doesn’t quite seem right*, and I don’t see the built-in widgets doing that.

Am I missing/misunderstanding something here?

*Edit: for one, I notice it causes a full re-layout to run on every event, according to the Comet debug metrics

Have you seen Reactive Rendering by hecrj · Pull Request #2662 · iced-rs/iced · GitHub? If not, I’d advise you to look at the changes in the Widget::update impl in Button between 0.13 and master

Ah, no, I hadn’t seen that PR - that helps to explain things.

Taking Button as an example, I’ll just add a status field to my widget which I can use to trigger a redraw.