renderer: don't allow the scrollbar state to block the renderer (#9270)

This fixes the source of a deadlock that some tip users have hit. If our
surface mailbox is full and there is a dirty scrollbar state, then
drawFrame would block forever trying to queue to the surface mailbox.

We now fail instantly if the queue is full and keep the scrollbar state
dirty. We can try again on the next frame, it's not a critical thing to
get updated.
pull/9278/head
Mitchell Hashimoto 2025-10-18 21:34:27 -07:00 committed by GitHub
commit be608ea2d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -1322,10 +1322,11 @@ pub fn Renderer(comptime GraphicsAPI: type) type {
// After the graphics API is complete (so we defer) we want to
// update our scrollbar state.
defer if (self.scrollbar_dirty) {
self.scrollbar_dirty = false;
_ = self.surface_mailbox.push(.{
// Fail instantly if the surface mailbox if full, we'll just
// get it on the next frame.
if (self.surface_mailbox.push(.{
.scrollbar = self.scrollbar,
}, .{ .forever = {} });
}, .instant) > 0) self.scrollbar_dirty = false;
};
// Let our graphics API do any bookkeeping, etc.