mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2024-11-16 22:25:59 +01:00
don't preload if exists
This commit is contained in:
parent
e15912e981
commit
b507e2f030
1 changed files with 14 additions and 0 deletions
|
@ -67,6 +67,20 @@ void CHyprpaper::preloadAllWallpapersFromConfig() {
|
|||
return;
|
||||
|
||||
for (auto& wp : g_pConfigManager->m_dRequestedPreloads) {
|
||||
|
||||
// check if it doesnt exist
|
||||
bool exists = false;
|
||||
for (auto&[ewp, cls] : m_mWallpaperTargets) {
|
||||
if (ewp == wp) {
|
||||
Debug::log(LOG, "Ignoring request to preload %s as it already is preloaded!", ewp.c_str());
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (exists)
|
||||
continue;
|
||||
|
||||
m_mWallpaperTargets[wp] = CWallpaperTarget();
|
||||
m_mWallpaperTargets[wp].create(wp);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue