summaryrefslogtreecommitdiff
path: root/src/helpers/Monitor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/Monitor.cpp')
-rw-r--r--src/helpers/Monitor.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index 6ad60dfa..d8bae3a8 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -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;