add parse errors for invalid kb layouts

This commit is contained in:
Vaxry 2022-08-09 18:13:13 +02:00
parent ecce027c02
commit e2f61e267e
3 changed files with 9 additions and 0 deletions

View file

@ -1349,3 +1349,8 @@ void CConfigManager::ensureDPMS() {
SAnimationPropertyConfig* CConfigManager::getAnimationPropertyConfig(const std::string& name) {
return &animationConfig[name];
}
void CConfigManager::addParseError(const std::string& err) {
if (parseError == "")
parseError = err;
}

View file

@ -100,6 +100,8 @@ public:
std::string parseKeyword(const std::string&, const std::string&, bool dynamic = false);
void addParseError(const std::string&);
SAnimationPropertyConfig* getAnimationPropertyConfig(const std::string&);
private:

View file

@ -536,6 +536,8 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) {
auto KEYMAP = xkb_keymap_new_from_names(CONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS);
if (!KEYMAP) {
g_pConfigManager->addParseError("Invalid keyboard layout passed. ( rules: " + RULES + ", model: " + MODEL + ", variant: " + VARIANT + ", options: " + OPTIONS + ", layout: " + LAYOUT + " )");
Debug::log(ERR, "Keyboard layout %s with variant %s (rules: %s, model: %s, options: %s) couldn't have been loaded.", rules.layout, rules.variant, rules.rules, rules.model, rules.options);
memset(&rules, 0, sizeof(rules));