From 8dd2cd41fb4c5a5eb6886cc190419b36084cabfa Mon Sep 17 00:00:00 2001 From: vaxerski Date: Sun, 19 Jan 2025 15:39:19 +0100 Subject: core: move to inotify for monitoring the config files instead of manually polling every second which is not efficient, use inotify. an added bonus is that inotify is much much faster --- src/managers/ThreadManager.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/managers/ThreadManager.cpp (limited to 'src/managers/ThreadManager.cpp') diff --git a/src/managers/ThreadManager.cpp b/src/managers/ThreadManager.cpp deleted file mode 100644 index bd124c99..00000000 --- a/src/managers/ThreadManager.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "ThreadManager.hpp" -#include "../debug/HyprCtl.hpp" -#include "../Compositor.hpp" -#include "../config/ConfigValue.hpp" - -static int handleTimer(void* data) { - const auto PTM = (CThreadManager*)data; - - static auto PDISABLECFGRELOAD = CConfigValue("misc:disable_autoreload"); - - if (*PDISABLECFGRELOAD != 1) - g_pConfigManager->tick(); - - wl_event_source_timer_update(PTM->m_esConfigTimer, 1000); - - return 0; -} - -CThreadManager::CThreadManager() : m_esConfigTimer(wl_event_loop_add_timer(g_pCompositor->m_sWLEventLoop, handleTimer, this)) { - wl_event_source_timer_update(m_esConfigTimer, 1000); -} - -CThreadManager::~CThreadManager() { - if (m_esConfigTimer) - wl_event_source_remove(m_esConfigTimer); -} -- cgit v1.2.3