diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-05-08 15:31:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-08 15:31:02 +0100 |
| commit | b94f1498542be0e83fe8060a50bce5ff2d5a1c39 (patch) | |
| tree | 8bddcfc9f8504817d5778136ec8c7c05d881c852 /src/desktop | |
| parent | a6a0cc308c827557d04cb3e4c3b5d258de0411e6 (diff) | |
config: allow hashes for parsing colors (#14337)
Diffstat (limited to 'src/desktop')
| -rw-r--r-- | src/desktop/Workspace.cpp | 5 | ||||
| -rw-r--r-- | src/desktop/rule/windowRule/WindowRule.cpp | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/desktop/Workspace.cpp b/src/desktop/Workspace.cpp index 18f77a63..293c57b5 100644 --- a/src/desktop/Workspace.cpp +++ b/src/desktop/Workspace.cpp @@ -2,6 +2,7 @@ #include "view/Group.hpp" #include "view/LayerSurface.hpp" #include "../Compositor.hpp" +#include "../config/shared/parserUtils/ParserUtils.hpp" #include "../config/shared/animation/AnimationTree.hpp" #include "../config/shared/workspace/WorkspaceRuleManager.hpp" #include "../config/supplementary/executor/Executor.hpp" @@ -199,7 +200,7 @@ bool CWorkspace::matchesStaticSelector(const std::string& selector_) { prop = prop.substr(2, prop.length() - 3); - const auto SHOULDBESPECIAL = configStringToInt(prop); + const auto SHOULDBESPECIAL = Config::ParserUtils::parseInt(prop); if (SHOULDBESPECIAL && sc<bool>(*SHOULDBESPECIAL) != m_isSpecialWorkspace) return false; @@ -234,7 +235,7 @@ bool CWorkspace::matchesStaticSelector(const std::string& selector_) { if (prop.starts_with("e:") && !m_name.ends_with(prop.substr(2))) return false; - const auto WANTSNAMED = configStringToInt(prop); + const auto WANTSNAMED = Config::ParserUtils::parseInt(prop); if (WANTSNAMED && *WANTSNAMED != (m_id <= -1337)) return false; diff --git a/src/desktop/rule/windowRule/WindowRule.cpp b/src/desktop/rule/windowRule/WindowRule.cpp index 5bbf2abe..0262697a 100644 --- a/src/desktop/rule/windowRule/WindowRule.cpp +++ b/src/desktop/rule/windowRule/WindowRule.cpp @@ -6,6 +6,7 @@ #include "../../../managers/TokenManager.hpp" #include "../../../desktop/state/FocusState.hpp" #include "../../../protocols/types/ContentType.hpp" +#include "../../../config/shared/parserUtils/ParserUtils.hpp" #include <hyprutils/string/Numeric.hpp> #include <hyprutils/string/String.hpp> @@ -45,7 +46,7 @@ static std::expected<float, std::string> parseFloat(std::string_view effectName, } static std::expected<CHyprColor, std::string> parseBorderColorToken(const std::string& raw, const std::string& token) { - auto parsed = configStringToInt(token); + auto parsed = Config::ParserUtils::parseColor(token); if (!parsed) return std::unexpected(std::format(R"(border_color rule "{}" has invalid color "{}": {})", raw, token, parsed.error())); |
