mirror of
https://github.com/polybar/polybar.git
synced 2024-11-11 13:50:56 -05:00
fix(xkeyboard): Minor tweaks
This commit is contained in:
parent
24c6e635a8
commit
2f3c2e952e
5 changed files with 11 additions and 11 deletions
2
.gitmodules
vendored
2
.gitmodules
vendored
|
@ -5,4 +5,4 @@
|
||||||
[submodule "lib/xpp"]
|
[submodule "lib/xpp"]
|
||||||
path = lib/xpp
|
path = lib/xpp
|
||||||
url = https://github.com/jaagr/xpp
|
url = https://github.com/jaagr/xpp
|
||||||
branch = 1.3.3
|
branch = 1.3.4
|
||||||
|
|
|
@ -28,12 +28,9 @@ namespace xpp {
|
||||||
class extension;
|
class extension;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
POLYBAR_NS
|
|
||||||
|
|
||||||
#if ENABLE_XKB_EXT
|
#if ENABLE_XKB_EXT
|
||||||
class xkb_extension;
|
namespace xkb {
|
||||||
|
class extension;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
POLYBAR_NS_END
|
|
||||||
|
|
2
lib/xpp
2
lib/xpp
|
@ -1 +1 @@
|
||||||
Subproject commit 34d0cf14e928270e3dd2ff3aab97f2208d409bff
|
Subproject commit 49ed2c142109fe92932ae906fc4b40b5138b2809
|
|
@ -99,12 +99,14 @@ namespace modules {
|
||||||
if (tag == TAG_LABEL_LAYOUT) {
|
if (tag == TAG_LABEL_LAYOUT) {
|
||||||
builder->node(m_layout);
|
builder->node(m_layout);
|
||||||
} else if (tag == TAG_LABEL_INDICATOR) {
|
} else if (tag == TAG_LABEL_INDICATOR) {
|
||||||
|
size_t n{0};
|
||||||
for (auto&& indicator : m_indicators) {
|
for (auto&& indicator : m_indicators) {
|
||||||
if (indicator != *m_indicators.begin()) {
|
if (n++) {
|
||||||
builder->space(m_formatter->get(DEFAULT_FORMAT)->spacing);
|
builder->space(m_formatter->get(DEFAULT_FORMAT)->spacing);
|
||||||
}
|
}
|
||||||
builder->node(indicator.second);
|
builder->node(indicator.second);
|
||||||
}
|
}
|
||||||
|
return n > 0;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -154,7 +156,7 @@ namespace modules {
|
||||||
* Handler for XCB_XKB_INDICATOR_STATE_NOTIFY events
|
* Handler for XCB_XKB_INDICATOR_STATE_NOTIFY events
|
||||||
*/
|
*/
|
||||||
void xkeyboard_module::handle(const evt::xkb_indicator_state_notify& evt) {
|
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);
|
m_keyboard->set(m_connection.xkb().get_state(XCB_XKB_ID_USE_CORE_KBD)->lockedMods);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "x11/connection.hpp"
|
#include "x11/connection.hpp"
|
||||||
#include "x11/extensions.hpp"
|
#include "x11/extensions.hpp"
|
||||||
|
|
||||||
#include "x11/registry.hpp"
|
#include "x11/registry.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
|
|
Loading…
Reference in a new issue