fix(xkeyboard): Minor tweaks

This commit is contained in:
Michael Carlberg 2016-11-30 11:29:41 +01:00
parent 24c6e635a8
commit 2f3c2e952e
5 changed files with 11 additions and 11 deletions

2
.gitmodules vendored
View File

@ -5,4 +5,4 @@
[submodule "lib/xpp"]
path = lib/xpp
url = https://github.com/jaagr/xpp
branch = 1.3.3
branch = 1.3.4

View File

@ -28,12 +28,9 @@ namespace xpp {
class extension;
}
#endif
}
POLYBAR_NS
#if ENABLE_XKB_EXT
class xkb_extension;
namespace xkb {
class extension;
}
#endif
POLYBAR_NS_END
}

@ -1 +1 @@
Subproject commit 34d0cf14e928270e3dd2ff3aab97f2208d409bff
Subproject commit 49ed2c142109fe92932ae906fc4b40b5138b2809

View File

@ -99,12 +99,14 @@ namespace modules {
if (tag == TAG_LABEL_LAYOUT) {
builder->node(m_layout);
} else if (tag == TAG_LABEL_INDICATOR) {
size_t n{0};
for (auto&& indicator : m_indicators) {
if (indicator != *m_indicators.begin()) {
if (n++) {
builder->space(m_formatter->get(DEFAULT_FORMAT)->spacing);
}
builder->node(indicator.second);
}
return n > 0;
} else {
return false;
}
@ -154,7 +156,7 @@ namespace modules {
* Handler for XCB_XKB_INDICATOR_STATE_NOTIFY events
*/
void xkeyboard_module::handle(const evt::xkb_indicator_state_notify& evt) {
if (m_xkbnotify.allow(evt->time)) {
if (m_xkbnotify.allow(evt->time) && m_keyboard) {
m_keyboard->set(m_connection.xkb().get_state(XCB_XKB_ID_USE_CORE_KBD)->lockedMods);
update();
}

View File

@ -1,5 +1,6 @@
#include "x11/connection.hpp"
#include "x11/extensions.hpp"
#include "x11/registry.hpp"
POLYBAR_NS