mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-09-01 12:23:48 -07:00
input: fix keyboard leds with multiple keyboards (#7079)
This commit is contained in:
@@ -274,9 +274,9 @@ std::string IKeyboard::getActiveLayout() {
|
||||
return "none";
|
||||
}
|
||||
|
||||
void IKeyboard::updateLEDs() {
|
||||
std::optional<uint32_t> IKeyboard::getLEDs() {
|
||||
if (xkbState == nullptr)
|
||||
return;
|
||||
return {};
|
||||
|
||||
uint32_t leds = 0;
|
||||
for (uint32_t i = 0; i < LED_COUNT; ++i) {
|
||||
@@ -284,7 +284,16 @@ void IKeyboard::updateLEDs() {
|
||||
leds |= (1 << i);
|
||||
}
|
||||
|
||||
updateLEDs(leds);
|
||||
return leds;
|
||||
}
|
||||
|
||||
void IKeyboard::updateLEDs() {
|
||||
std::optional<uint32_t> leds = getLEDs();
|
||||
|
||||
if (!leds.has_value())
|
||||
return;
|
||||
|
||||
updateLEDs(leds.value());
|
||||
}
|
||||
|
||||
void IKeyboard::updateLEDs(uint32_t leds) {
|
||||
|
Reference in New Issue
Block a user