mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-20 14:44:43 +00:00
WindowServer+LibGUI: Notify DisplayLinks at 60 fps no matter what
The original implementation only sent out notifications when there was something being drawn on screen. If nothing was going on, we'd get too lazy and just not notify display links. This obviously break requestAnimationFrame(), so now we just drive the DisplayLinks at 60 fps no matter what. :^)
This commit is contained in:
@@ -342,7 +342,14 @@ void WindowServerConnection::handle(const Messages::WindowClient::WindowStateCha
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::DisplayLinkNotification&)
|
||||
{
|
||||
DisplayLink::notify({});
|
||||
if (m_display_link_notification_pending)
|
||||
return;
|
||||
|
||||
m_display_link_notification_pending = true;
|
||||
deferred_invoke([this](auto&) {
|
||||
DisplayLink::notify({});
|
||||
m_display_link_notification_pending = false;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user