summaryrefslogtreecommitdiff
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-31 00:27:32 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-31 00:27:32 +0200
commitedac94bed14ab208d61f2867e5464ac576781c8b (patch)
tree48c010f62bc41ce951181fe8931df1c7729f408b /src/Compositor.cpp
parent4610b3d86445243192d814fa9d127c38ad10c8cb (diff)
tick hyprctl separately
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index a82bbd1c..a4a322d8 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -1,6 +1,7 @@
#include "Compositor.hpp"
#include "helpers/Splashes.hpp"
#include <random>
+#include "debug/HyprCtl.hpp"
int handleCritSignal(int signo, void* data) {
Debug::log(LOG, "Hyprland received signal %d", signo);
@@ -1477,4 +1478,21 @@ CWindow* CCompositor::getWindowByRegex(const std::string& regexp) {
}
return nullptr;
+}
+
+wl_event_source* hyprCtlTickSource = nullptr;
+
+int hyprCtlTick(void* data) {
+ HyprCtl::tickHyprCtl(); // so that we dont get that race condition multithread bullshit
+
+ wl_event_source_timer_update(hyprCtlTickSource, 16); // tick it 60/s, should be enough.
+}
+
+void CCompositor::startHyprCtlTick() {
+ if (hyprCtlTickSource)
+ return;
+
+ hyprCtlTickSource = wl_event_loop_add_timer(m_sWLEventLoop, hyprCtlTick, nullptr);
+
+ wl_event_source_timer_update(hyprCtlTickSource, 16);
} \ No newline at end of file