mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-02 01:46:01 +01: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
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
#include "Compositor.hpp"
|
#include "Compositor.hpp"
|
||||||
#include "DataDevice.hpp"
|
#include "DataDevice.hpp"
|
||||||
#include "../../devices/IKeyboard.hpp"
|
#include "../../devices/IKeyboard.hpp"
|
||||||
|
#include "../../devices/IHID.hpp"
|
||||||
#include "../../managers/SeatManager.hpp"
|
#include "../../managers/SeatManager.hpp"
|
||||||
#include "../../config/ConfigValue.hpp"
|
#include "../../config/ConfigValue.hpp"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -451,12 +452,18 @@ void CWLSeatProtocol::updateCapabilities(uint32_t caps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWLSeatProtocol::updateKeymap() {
|
void CWLSeatProtocol::updateKeymap() {
|
||||||
|
if (!(currentCaps & eHIDCapabilityType::HID_INPUT_CAPABILITY_KEYBOARD))
|
||||||
|
return;
|
||||||
|
|
||||||
for (auto& k : m_vKeyboards) {
|
for (auto& k : m_vKeyboards) {
|
||||||
k->sendKeymap(g_pSeatManager->keyboard.lock());
|
k->sendKeymap(g_pSeatManager->keyboard.lock());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWLSeatProtocol::updateRepeatInfo(uint32_t rate, uint32_t delayMs) {
|
void CWLSeatProtocol::updateRepeatInfo(uint32_t rate, uint32_t delayMs) {
|
||||||
|
if (!(currentCaps & eHIDCapabilityType::HID_INPUT_CAPABILITY_KEYBOARD))
|
||||||
|
return;
|
||||||
|
|
||||||
for (auto& k : m_vKeyboards) {
|
for (auto& k : m_vKeyboards) {
|
||||||
k->repeatInfo(rate, delayMs);
|
k->repeatInfo(rate, delayMs);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue