Feat: Introduce render_ahead_of_time (#1863)

This commit is contained in:
Vaxry
2023-03-24 19:23:16 +00:00
committed by GitHub
parent b3a70b565e
commit a80f8f257f
7 changed files with 312 additions and 230 deletions

View File

@@ -2,6 +2,12 @@
#include "../Compositor.hpp"
int ratHandler(void* data) {
g_pHyprRenderer->renderMonitor((CMonitor*)data);
return 1;
}
void CMonitor::onConnect(bool noRule) {
hyprListener_monitorDestroy.removeCallback();
hyprListener_monitorFrame.removeCallback();
@@ -156,10 +162,17 @@ void CMonitor::onConnect(bool noRule) {
if (!found)
g_pCompositor->setActiveMonitor(this);
renderTimer = wl_event_loop_add_timer(g_pCompositor->m_sWLEventLoop, ratHandler, this);
}
void CMonitor::onDisconnect() {
if (renderTimer) {
wl_event_source_remove(renderTimer);
renderTimer = nullptr;
}
if (!m_bEnabled || g_pCompositor->m_bIsShuttingDown)
return;