mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-01 20:51:58 -07:00
Feat: Introduce render_ahead_of_time (#1863)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user