Merge pull request #1125 from maximbaz/sway-language-ignore-empty
This commit is contained in:
commit
6e041d5275
|
@ -45,8 +45,10 @@ void Language::onEvent(const struct Ipc::ipc_response& res) {
|
|||
auto payload = parser_.parse(res.payload)["input"];
|
||||
if (payload["type"].asString() == "keyboard") {
|
||||
auto layout_name = payload["xkb_active_layout_name"].asString().substr(0,2);
|
||||
if (!layout_name.empty()) {
|
||||
lang_ = Glib::Markup::escape_text(layout_name);
|
||||
}
|
||||
}
|
||||
dp.emit();
|
||||
} catch (const std::exception& e) {
|
||||
spdlog::error("Language: {}", e.what());
|
||||
|
|
Loading…
Reference in New Issue