Skip to content

Conversation

@Ph4ntomas
Copy link
Contributor

@Ph4ntomas Ph4ntomas commented Oct 21, 2025

As discussed in #364, here is the standalone PR for snowcap event pooling.

This fix an issue that arose when more than one events are either generated before the config have had the time to generate a new view, or while the view was "in flight"

As an example, if we take a mouse area:

  • First view generation. MouseArea has the id 1.
  • The user double click on the area, two events are generated: MsgPress{1} & MsgDoubleClick{1}.
  • The config receive MsgPress{1}, update itself and generate a new view. MouseArea now has the id 2.
  • The config receive MsgDoubleClick{1}, the event is discarded because there are no widgets with this id.

This PR does two thing: Pool events so the config gets every pending events at once, and buffer events if we're expecting a new view, meaning the config will always receive all events available and that said events will always be "in sync" with the view.

Surface::update can be called again after sending events while the
config is still busy handling previous ones, or the new view definition
is in-flight.

With this commit, we buffer new events until after the new view is
received.
Copy link
Collaborator

@Ottatop Ottatop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Ottatop Ottatop merged commit c2a8300 into pinnacle-comp:main Oct 21, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants