mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 07:05:58 +01:00
add parse errors for invalid kb layouts
This commit is contained in:
parent
ecce027c02
commit
e2f61e267e
3 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
}
|
|
@ -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:
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in a new issue