-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Firefox surface.frame
event quirk
#3740
Improve Firefox surface.frame
event quirk
#3740
Conversation
We want to move the `executor_send_frame_callback` into its consumer; this obviously doesn't work if it's `const`.
surface.frame
event quirk
I think we might also want to fix issue #3739 while we're here, but I didn't want to block this on that. I've had a look, and it's not much work, but there's some subtlety around |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sensible, it isn't immediately obvious why the wp-viewporter tests are failing. But as they sync using the frame callback there's likely an implicit assumption that no longer holds
We currently queue a `send_frame_events()` 16ms after receiving a `surface.commit()` with no buffer but that requests a frame event. When `send_frame_events()` is triggered it sends *all* the frame events at the time of trigger; this results in us sending frame events at a sub-optimal time and breaks the way that WLCS uses the frame event to determine when a buffer has been used. Instead, maintain a separate `heartbeat_quirk_frame_events` list that gets sent by the 16ms timer.
Oops! The `FrameExecutor` (annoyingly!) doesn't execute on the Wayland event loop. We need a second bounce to get the `send_frame_callbacks()` call there.
c028ed1
to
6c88bcd
Compare
Ok! The problem was that the new code was broken! (it was never triggered). The WpViewporter tests happen to use buffer-less frame events, so that's why those broke. It seems that Firefox is more tolerant of not sending those events than it was (although, now that I've actually fixed it I can see that there are behavioural differences that just seemed like regular weirdness 🤷♀️ ) |
There's now also a WLCS test that catches this: canonical/wlcs#350 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's what we missed!
We currently queue a
send_frame_events()
16ms after receivinga
surface.commit()
with no buffer but that requests a frameevent.
When
send_frame_events()
is triggered it sends all the frameevents at the time of trigger; this results in us sending frame
events at a sub-optimal time and breaks the way that WLCS uses
the frame event to determine when a buffer has been used.
Instead, maintain a separate
heartbeat_quirk_frame_events
listthat gets sent by the 16ms timer.