asyncResourceGatherer: skip processing screenshot paths and remove initThread (#189)

* asyncResourceGatherer: skip processing screenshot paths

* asyncResourceGatherer: remove initThread
This commit is contained in:
Maximilian Seidler 2024-03-13 22:23:21 +01:00 committed by GitHub
parent 0fe1028255
commit 9466f59327
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 7 deletions

View File

@ -10,12 +10,11 @@
std::mutex cvmtx; std::mutex cvmtx;
CAsyncResourceGatherer::CAsyncResourceGatherer() { CAsyncResourceGatherer::CAsyncResourceGatherer() {
initThread = std::thread([this]() { asyncLoopThread = std::thread([this]() {
this->gather(); this->gather(); /* inital gather */
this->asyncLoopThread = std::thread([this]() { this->asyncAssetSpinLock(); }); this->asyncAssetSpinLock();
this->asyncLoopThread.detach();
}); });
initThread.detach(); asyncLoopThread.detach();
// some things can't be done async :( // some things can't be done async :(
// gather background textures when needed // gather background textures when needed
@ -128,7 +127,7 @@ void CAsyncResourceGatherer::gather() {
std::string path = std::any_cast<Hyprlang::STRING>(c.values.at("path")); std::string path = std::any_cast<Hyprlang::STRING>(c.values.at("path"));
if (path.empty()) if (path.empty() || path == "screenshot")
continue; continue;
std::string id = std::string{"background:"} + path; std::string id = std::string{"background:"} + path;

View File

@ -52,7 +52,6 @@ class CAsyncResourceGatherer {
void recheckDMAFramesFor(COutput* output); void recheckDMAFramesFor(COutput* output);
private: private:
std::thread initThread;
std::thread asyncLoopThread; std::thread asyncLoopThread;
void asyncAssetSpinLock(); void asyncAssetSpinLock();