fix(xkeyboard): Only update indicators when used

Was causing a segfault if `format = <label-layout>`
This commit is contained in:
patrick96 2019-03-01 16:38:07 +01:00 committed by NBonaparte
parent de3240b861
commit b3f7cd08e9

View File

@ -130,6 +130,7 @@ namespace modules {
m_layout->replace_token("%number%", to_string(m_keyboard->current())); m_layout->replace_token("%number%", to_string(m_keyboard->current()));
} }
if (m_formatter->has(TAG_LABEL_INDICATOR)) {
m_indicators.clear(); m_indicators.clear();
for (auto it : INDICATOR_TYPES) { for (auto it : INDICATOR_TYPES) {
@ -157,6 +158,7 @@ namespace modules {
indicator->replace_token("%icon%", icon->get()); indicator->replace_token("%icon%", icon->get());
m_indicators.emplace(it, move(indicator)); m_indicators.emplace(it, move(indicator));
} }
}
// Trigger redraw // Trigger redraw
broadcast(); broadcast();