From 37e2311a3e4124930e1a66de8f8de040f9b7571c Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:58:01 +0200 Subject: [PATCH] config: loosen restrictions around animation keywords Fixes #3185, makes hyprland ignore further args if an animation is disabled --- src/config/ConfigManager.cpp | 44 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index e46785ccd..cd98dd1a6 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -752,35 +752,37 @@ void CConfigManager::handleAnimation(const std::string& command, const std::stri parseError = "invalid animation on/off state"; } - // speed - if (isNumber(ARGS[2], true)) { - PANIM->second.internalSpeed = std::stof(ARGS[2]); + if (PANIM->second.internalEnabled) { + // speed + if (isNumber(ARGS[2], true)) { + PANIM->second.internalSpeed = std::stof(ARGS[2]); - if (PANIM->second.internalSpeed <= 0) { + if (PANIM->second.internalSpeed <= 0) { + parseError = "invalid speed"; + PANIM->second.internalSpeed = 1.f; + } + } else { + PANIM->second.internalSpeed = 10.f; parseError = "invalid speed"; - PANIM->second.internalSpeed = 1.f; } - } else { - PANIM->second.internalSpeed = 10.f; - parseError = "invalid speed"; - } - // curve - PANIM->second.internalBezier = ARGS[3]; + // curve + PANIM->second.internalBezier = ARGS[3]; - if (!g_pAnimationManager->bezierExists(ARGS[3])) { - parseError = "no such bezier"; - PANIM->second.internalBezier = "default"; - } + if (!g_pAnimationManager->bezierExists(ARGS[3])) { + parseError = "no such bezier"; + PANIM->second.internalBezier = "default"; + } - // style - PANIM->second.internalStyle = ARGS[4]; + // style + PANIM->second.internalStyle = ARGS[4]; - if (ARGS[4] != "") { - const auto ERR = g_pAnimationManager->styleValidInConfigVar(ANIMNAME, ARGS[4]); + if (ARGS[4] != "") { + const auto ERR = g_pAnimationManager->styleValidInConfigVar(ANIMNAME, ARGS[4]); - if (ERR != "") - parseError = ERR; + if (ERR != "") + parseError = ERR; + } } // now, check for children, recursively