mirror of https://github.com/hyprwm/Hyprland
Fix #6279: prevent sending keymap or repeat info events by keyboards without keyboard capability
This commit is contained in:
parent
b7f42a1e88
commit
2d7a0ab21f
|
@ -2,6 +2,7 @@
|
|||
#include "Compositor.hpp"
|
||||
#include "DataDevice.hpp"
|
||||
#include "../../devices/IKeyboard.hpp"
|
||||
#include "../../devices/IHID.hpp"
|
||||
#include "../../managers/SeatManager.hpp"
|
||||
#include "../../config/ConfigValue.hpp"
|
||||
#include <algorithm>
|
||||
|
@ -451,12 +452,20 @@ void CWLSeatProtocol::updateCapabilities(uint32_t caps) {
|
|||
}
|
||||
|
||||
void CWLSeatProtocol::updateKeymap() {
|
||||
if (!(currentCaps & eHIDCapabilityType::HID_INPUT_CAPABILITY_KEYBOARD)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto& k : m_vKeyboards) {
|
||||
k->sendKeymap(g_pSeatManager->keyboard.lock());
|
||||
}
|
||||
}
|
||||
|
||||
void CWLSeatProtocol::updateRepeatInfo(uint32_t rate, uint32_t delayMs) {
|
||||
if (!(currentCaps & eHIDCapabilityType::HID_INPUT_CAPABILITY_KEYBOARD)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto& k : m_vKeyboards) {
|
||||
k->repeatInfo(rate, delayMs);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue