mirror of
https://github.com/hyprwm/hyprlock.git
synced 2025-12-20 00:40: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() {
|
||||
const auto FADEINCFG = g_pConfigManager->m_AnimationTree.getConfig("fadeIn");
|
||||
const auto FADEOUTCFG = g_pConfigManager->m_AnimationTree.getConfig("fadeOut");
|
||||
static const auto ANIMATIONSENABLED = g_pConfigManager->getValue<Hyprlang::INT>("animations:enabled");
|
||||
|
||||
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) { //
|
||||
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 && (!FADEINCFG->pValues || !FADEINCFG->pValues->internalEnabled) && //
|
||||
(!FADEOUTCFG->pValues || !FADEOUTCFG->pValues->internalEnabled))
|
||||
if (!BGSCREENSHOT && !FADENEEDSSC) {
|
||||
Debug::log(LOG, "Skipping screencopy");
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto& MON : g_pHyprlock->m_vOutputs) {
|
||||
scframes.emplace_back(makeUnique<CScreencopyFrame>(MON));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue