mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
WindowServer+LibGUI: Add a way to get notified at display refresh rate
This patch adds GUI::DisplayLink, a mechanism for registering callbacks that will fire at the display refresh rate. Note that we don't actually know the screen refresh rate, but this is instead completely driven by WindowServer's compositing timer. For all current intents and purposes it does the job well enough. :^)
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Clipboard.h>
|
||||
#include <LibGUI/Desktop.h>
|
||||
#include <LibGUI/DisplayLink.h>
|
||||
#include <LibGUI/DragOperation.h>
|
||||
#include <LibGUI/Event.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
@@ -339,4 +340,9 @@ void WindowServerConnection::handle(const Messages::WindowClient::WindowStateCha
|
||||
window->notify_state_changed({}, message.minimized(), message.occluded());
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::DisplayLinkNotification&)
|
||||
{
|
||||
DisplayLink::notify({});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user