mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +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:
parent
2d4c91df8e
commit
5326eebb1b
Notes:
sideshowbarker
2024-07-19 07:24:34 +09:00
Author: https://github.com/awesomekling
Commit: 5326eebb1b
5 changed files with 47 additions and 2 deletions
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue