2022-03-18 20:03:39 +01:00
|
|
|
#include "ThreadManager.hpp"
|
2022-03-20 16:51:14 +01:00
|
|
|
#include "../debug/HyprCtl.hpp"
|
2022-07-21 12:33:22 +02:00
|
|
|
#include "../Compositor.hpp"
|
2024-03-03 19:39:20 +01:00
|
|
|
#include "../config/ConfigValue.hpp"
|
2022-03-17 15:53:45 +01:00
|
|
|
|
2022-07-21 12:33:22 +02:00
|
|
|
int slowUpdate = 0;
|
2022-03-17 15:53:45 +01:00
|
|
|
|
2022-07-21 12:33:22 +02:00
|
|
|
int handleTimer(void* data) {
|
2024-03-03 19:39:20 +01:00
|
|
|
const auto PTM = (CThreadManager*)data;
|
2022-03-17 15:53:45 +01:00
|
|
|
|
2024-03-03 19:39:20 +01:00
|
|
|
static auto PDISABLECFGRELOAD = CConfigValue<Hyprlang::INT>("misc:disable_autoreload");
|
2022-09-10 17:28:41 +02:00
|
|
|
|
2024-03-03 19:39:20 +01:00
|
|
|
if (*PDISABLECFGRELOAD != 1)
|
2022-09-10 17:28:41 +02:00
|
|
|
g_pConfigManager->tick();
|
2022-03-17 15:53:45 +01:00
|
|
|
|
2022-07-21 12:33:22 +02:00
|
|
|
wl_event_source_timer_update(PTM->m_esConfigTimer, 1000);
|
2022-03-20 19:58:12 +01:00
|
|
|
|
2022-07-21 12:33:22 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2022-03-17 17:08:54 +01:00
|
|
|
|
2022-07-21 12:33:22 +02:00
|
|
|
CThreadManager::CThreadManager() {
|
|
|
|
m_esConfigTimer = wl_event_loop_add_timer(g_pCompositor->m_sWLEventLoop, handleTimer, this);
|
|
|
|
|
|
|
|
wl_event_source_timer_update(m_esConfigTimer, 1000);
|
|
|
|
}
|
2022-03-17 15:53:45 +01:00
|
|
|
|
2022-07-21 12:33:22 +02:00
|
|
|
CThreadManager::~CThreadManager() {
|
|
|
|
//
|
2022-03-17 15:53:45 +01:00
|
|
|
}
|