From 9926c0f69ed6be45fd6e29f0e19aac26e874bbaf Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 31 Jul 2022 17:30:14 +0200 Subject: [PATCH] fix ticks not firing --- src/Hyprpaper.cpp | 10 +++++----- src/Hyprpaper.hpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Hyprpaper.cpp b/src/Hyprpaper.cpp index 6a9b2ed..ec212ad 100644 --- a/src/Hyprpaper.cpp +++ b/src/Hyprpaper.cpp @@ -29,14 +29,14 @@ void CHyprpaper::init() { if (m_bIPCEnabled) { std::thread([&]() { // we dispatch wl events cuz we have to while (wl_display_dispatch(m_sDisplay) != -1) { - tick(); + tick(true); } m_bShouldExit = true; }).detach(); while (1) { // we also tick every 1ms for socket and other shit's updates - tick(); + tick(false); std::this_thread::sleep_for(std::chrono::milliseconds(1)); @@ -45,17 +45,17 @@ void CHyprpaper::init() { } } else { while (wl_display_dispatch(m_sDisplay) != -1) { - tick(); + tick(true); } } } -void CHyprpaper::tick() { +void CHyprpaper::tick(bool force) { std::lock_guard lg(m_mtTickMutex); bool reload = g_pIPCSocket->mainThreadParseRequest(); - if (!reload) + if (!reload && !force) return; preloadAllWallpapersFromConfig(); diff --git a/src/Hyprpaper.hpp b/src/Hyprpaper.hpp index b698258..df511e8 100644 --- a/src/Hyprpaper.hpp +++ b/src/Hyprpaper.hpp @@ -20,7 +20,7 @@ public: // init the utility CHyprpaper(); void init(); - void tick(); + void tick(bool force); std::unordered_map m_mWallpaperTargets; std::unordered_map m_mMonitorActiveWallpapers;