Skip processing key and pointer event spies on X

These were needed for the modifier only shortcuts event spy, which has
been dropped recently.
This commit is contained in:
Vlad Zahorodnii 2024-07-05 17:15:26 +03:00
parent 2adf962467
commit 12c12b3af1
2 changed files with 13 additions and 13 deletions

View file

@ -223,6 +223,11 @@ void KeyboardInputRedirection::update()
void KeyboardInputRedirection::processKey(uint32_t key, InputRedirection::KeyboardKeyState state, std::chrono::microseconds time, InputDevice *device)
{
input()->setLastInputHandler(this);
if (!m_inited) {
return;
}
QEvent::Type type;
bool autoRepeat = false;
switch (state) {
@ -258,10 +263,6 @@ void KeyboardInputRedirection::processKey(uint32_t key, InputRedirection::Keyboa
event.setModifiersRelevantForGlobalShortcuts(globalShortcutsModifiers);
m_input->processSpies(std::bind(&InputEventSpy::keyEvent, std::placeholders::_1, &event));
if (!m_inited) {
return;
}
input()->setLastInputHandler(this);
m_input->processFilters(std::bind(&InputEventFilter::keyEvent, std::placeholders::_1, &event));
m_xkb->forwardModifiers();

View file

@ -266,6 +266,10 @@ void PointerInputRedirection::processMotionInternal(const QPointF &pos, const QP
void PointerInputRedirection::processButton(uint32_t button, InputRedirection::PointerButtonState state, std::chrono::microseconds time, InputDevice *device)
{
input()->setLastInputHandler(this);
if (!inited()) {
return;
}
QEvent::Type type;
switch (state) {
case InputRedirection::PointerButtonReleased:
@ -288,11 +292,6 @@ void PointerInputRedirection::processButton(uint32_t button, InputRedirection::P
event.setNativeButton(button);
input()->processSpies(std::bind(&InputEventSpy::pointerEvent, std::placeholders::_1, &event));
if (!inited()) {
return;
}
input()->processFilters(std::bind(&InputEventFilter::pointerEvent, std::placeholders::_1, &event, button));
if (state == InputRedirection::PointerButtonReleased) {
@ -304,6 +303,10 @@ void PointerInputRedirection::processAxis(InputRedirection::PointerAxis axis, qr
InputRedirection::PointerAxisSource source, std::chrono::microseconds time, InputDevice *device)
{
input()->setLastInputHandler(this);
if (!inited()) {
return;
}
update();
Q_EMIT input()->pointerAxisChanged(axis, delta);
@ -314,10 +317,6 @@ void PointerInputRedirection::processAxis(InputRedirection::PointerAxis axis, qr
wheelEvent.setModifiersRelevantForGlobalShortcuts(input()->modifiersRelevantForGlobalShortcuts());
input()->processSpies(std::bind(&InputEventSpy::wheelEvent, std::placeholders::_1, &wheelEvent));
if (!inited()) {
return;
}
input()->processFilters(std::bind(&InputEventFilter::wheelEvent, std::placeholders::_1, &wheelEvent));
}