mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-10-30 05:51:44 +00:00
seat: don't send keyboard data without a keyboard cap (#6697)
* Fix #6279: prevent sending keymap or repeat info events by keyboards without keyboard capability * Remove brackets
This commit is contained in:
parent
1f43a5c859
commit
718afe271e
@ -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,18 @@ 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
Block a user