fix hyprland/language layout parsing
This commit is contained in:
@ -70,8 +70,14 @@ void Language::onEvent(const std::string& ev) {
|
|||||||
// Last comma before variants parenthesis, eg:
|
// Last comma before variants parenthesis, eg:
|
||||||
// activelayout>>micro-star-int'l-co.,-ltd.-msi-gk50-elite-gaming-keyboard,English (US, intl.,
|
// activelayout>>micro-star-int'l-co.,-ltd.-msi-gk50-elite-gaming-keyboard,English (US, intl.,
|
||||||
// with dead keys)
|
// with dead keys)
|
||||||
std::string beforParenthesis(begin(ev), begin(ev) + ev.find_last_of('('));
|
std::string beforeParenthesis;
|
||||||
auto layoutName = ev.substr(beforParenthesis.find_last_of(',') + 1);
|
auto parenthesisPos = ev.find_last_of('(');
|
||||||
|
if (parenthesisPos == std::string::npos) {
|
||||||
|
beforeParenthesis = ev;
|
||||||
|
} else {
|
||||||
|
beforeParenthesis = std::string(begin(ev), begin(ev) + parenthesisPos);
|
||||||
|
}
|
||||||
|
auto layoutName = ev.substr(beforeParenthesis.find_last_of(',') + 1);
|
||||||
|
|
||||||
if (config_.isMember("keyboard-name") && kbName != config_["keyboard-name"].asString())
|
if (config_.isMember("keyboard-name") && kbName != config_["keyboard-name"].asString())
|
||||||
return; // ignore
|
return; // ignore
|
||||||
|
Reference in New Issue
Block a user