diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-05-01 23:50:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-01 23:50:26 +0100 |
| commit | 6e1fcfa81e55a7d78e40fdb5c41700c18b0e1268 (patch) | |
| tree | ee7a3a082701dc5403dbad75d6c8db3460df34fe /src | |
| parent | 4ab3a40398d1331b69e033ab14533524c554a002 (diff) | |
hyprctl: fix getoption with custom types (#14243)
Diffstat (limited to 'src')
| -rw-r--r-- | src/debug/HyprCtl.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 278e92c6..e84a5552 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -1644,6 +1644,14 @@ static std::string dispatchGetOption(eHyprCtlOutputFormat format, std::string re return std::format("str: {}\nset: {}", **rc<Config::STRING* const*>(VAL), VAR.setByUser); else if (TYPE == typeid(void*)) return std::format("custom type: {}\nset: {}", rc<Config::IComplexConfigValue*>((*rc<Hyprlang::CUSTOMTYPE* const*>(VAL))->getData())->toString(), VAR.setByUser); + else if (TYPE == typeid(Config::IComplexConfigValue)) + return std::format("custom type: {}\nset: {}", (*rc<Config::IComplexConfigValue* const*>(VAL))->toString(), VAR.setByUser); + else if (TYPE == typeid(Config::CCssGapData)) + return std::format("css gap data: {}\nset: {}", (*rc<Config::CCssGapData* const*>(VAL))->toString(), VAR.setByUser); + else if (TYPE == typeid(Config::CGradientValueData)) + return std::format("gradient data: {}\nset: {}", (*rc<Config::CGradientValueData* const*>(VAL))->toString(), VAR.setByUser); + else if (TYPE == typeid(Config::CFontWeightConfigValueData)) + return std::format("font weight data: {}\nset: {}", (*rc<Config::CFontWeightConfigValueData* const*>(VAL))->toString(), VAR.setByUser); } else { if (TYPE == typeid(Config::INTEGER)) return std::format(R"({{"option": "{}", "int": {}, "set": {} }})", curitem, **rc<Config::INTEGER* const*>(VAL), VAR.setByUser); @@ -1662,6 +1670,15 @@ static std::string dispatchGetOption(eHyprCtlOutputFormat format, std::string re else if (TYPE == typeid(void*)) return std::format(R"({{"option": "{}", "custom": "{}", "set": {} }})", curitem, rc<Config::IComplexConfigValue*>((*rc<Hyprlang::CUSTOMTYPE* const*>(VAL))->getData())->toString(), VAR.setByUser); + else if (TYPE == typeid(Config::IComplexConfigValue)) + return std::format(R"({{"option": "{}", "custom": "{}", "set": {} }})", curitem, (*rc<Config::IComplexConfigValue* const*>(VAL))->toString(), VAR.setByUser); + else if (TYPE == typeid(Config::CCssGapData)) + return std::format(R"({{"option": "{}", "css": "{}", "set": {} }})", curitem, (*rc<Config::CCssGapData* const*>(VAL))->toString(), VAR.setByUser); + else if (TYPE == typeid(Config::CGradientValueData)) + return std::format(R"({{"option": "{}", "gradient": "{}", "set": {} }})", curitem, (*rc<Config::CGradientValueData* const*>(VAL))->toString(), VAR.setByUser); + else if (TYPE == typeid(Config::CFontWeightConfigValueData)) + return std::format(R"({{"option": "{}", "font_weight": "{}", "set": {} }})", curitem, (*rc<Config::CFontWeightConfigValueData* const*>(VAL))->toString(), + VAR.setByUser); } return "invalid type (internal error)"; |
