mirror of
https://github.com/hyprwm/hyprlock.git
synced 2025-12-25 03:10:03 +01:00
asyncResourceGatherer: fix conditions for skipping screencopy (#829)
This commit is contained in:
parent
8ebcee2969
commit
d993bdc105
1 changed files with 12 additions and 5 deletions
|
|
@ -28,16 +28,23 @@ CAsyncResourceGatherer::CAsyncResourceGatherer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAsyncResourceGatherer::enqueueScreencopyFrames() {
|
void CAsyncResourceGatherer::enqueueScreencopyFrames() {
|
||||||
const auto FADEINCFG = g_pConfigManager->m_AnimationTree.getConfig("fadeIn");
|
static const auto ANIMATIONSENABLED = g_pConfigManager->getValue<Hyprlang::INT>("animations:enabled");
|
||||||
const auto FADEOUTCFG = g_pConfigManager->m_AnimationTree.getConfig("fadeOut");
|
|
||||||
|
const auto FADEINCFG = g_pConfigManager->m_AnimationTree.getConfig("fadeIn");
|
||||||
|
const auto FADEOUTCFG = g_pConfigManager->m_AnimationTree.getConfig("fadeOut");
|
||||||
|
|
||||||
|
const bool FADENEEDSSC = *ANIMATIONSENABLED &&
|
||||||
|
((FADEINCFG->pValues && FADEINCFG->pValues->internalEnabled) || // fadeIn or fadeOut enabled
|
||||||
|
(FADEOUTCFG->pValues && FADEOUTCFG->pValues->internalEnabled));
|
||||||
|
|
||||||
const auto BGSCREENSHOT = std::ranges::any_of(g_pConfigManager->getWidgetConfigs(), [](const auto& w) { //
|
const auto BGSCREENSHOT = std::ranges::any_of(g_pConfigManager->getWidgetConfigs(), [](const auto& w) { //
|
||||||
return w.type == "background" && std::string{std::any_cast<Hyprlang::STRING>(w.values.at("path"))} == "screenshot";
|
return w.type == "background" && std::string{std::any_cast<Hyprlang::STRING>(w.values.at("path"))} == "screenshot";
|
||||||
});
|
});
|
||||||
|
|
||||||
// No screenshot background AND no fade in AND no fade out -> we don't need screencopy
|
if (!BGSCREENSHOT && !FADENEEDSSC) {
|
||||||
if (!BGSCREENSHOT && (!FADEINCFG->pValues || !FADEINCFG->pValues->internalEnabled) && //
|
Debug::log(LOG, "Skipping screencopy");
|
||||||
(!FADEOUTCFG->pValues || !FADEOUTCFG->pValues->internalEnabled))
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto& MON : g_pHyprlock->m_vOutputs) {
|
for (const auto& MON : g_pHyprlock->m_vOutputs) {
|
||||||
scframes.emplace_back(makeUnique<CScreencopyFrame>(MON));
|
scframes.emplace_back(makeUnique<CScreencopyFrame>(MON));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue