mirror of
https://github.com/polybar/polybar.git
synced 2026-02-06 00:45:33 +00:00
fix(xkeyboard): Minor tweaks
This commit is contained in:
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -5,4 +5,4 @@
|
||||
[submodule "lib/xpp"]
|
||||
path = lib/xpp
|
||||
url = https://github.com/jaagr/xpp
|
||||
branch = 1.3.3
|
||||
branch = 1.3.4
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
2
lib/xpp
2
lib/xpp
Submodule lib/xpp updated: 34d0cf14e9...49ed2c1421
@ -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();
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include "x11/connection.hpp"
|
||||
#include "x11/extensions.hpp"
|
||||
|
||||
#include "x11/registry.hpp"
|
||||
|
||||
POLYBAR_NS
|
||||
|
||||
Reference in New Issue
Block a user