mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-11-16 23:05:58 +01:00
asyncResourceGatherer: skip processing screenshot paths and remove initThread (#189)
* asyncResourceGatherer: skip processing screenshot paths * asyncResourceGatherer: remove initThread
This commit is contained in:
parent
0fe1028255
commit
9466f59327
2 changed files with 5 additions and 7 deletions
|
@ -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;
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue