mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2024-09-11 19:07:40 +03:00
fix ticks not firing
This commit is contained in:
parent
c3eba7ea3c
commit
9926c0f69e
@ -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<std::mutex> lg(m_mtTickMutex);
|
||||
|
||||
bool reload = g_pIPCSocket->mainThreadParseRequest();
|
||||
|
||||
if (!reload)
|
||||
if (!reload && !force)
|
||||
return;
|
||||
|
||||
preloadAllWallpapersFromConfig();
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
// init the utility
|
||||
CHyprpaper();
|
||||
void init();
|
||||
void tick();
|
||||
void tick(bool force);
|
||||
|
||||
std::unordered_map<std::string, CWallpaperTarget> m_mWallpaperTargets;
|
||||
std::unordered_map<std::string, std::string> m_mMonitorActiveWallpapers;
|
||||
|
Loading…
Reference in New Issue
Block a user