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

View file

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