[wayland] Pass keyboard key press/released events to SeatInterface
Improves handling by no longer sending events with xtest.icc-effect-5.14.5
parent
c29f96665d
commit
7bb107ba6d
29
input.cpp
29
input.cpp
|
@ -395,7 +395,6 @@ void InputRedirection::processPointerAxis(InputRedirection::PointerAxis axis, qr
|
||||||
|
|
||||||
void InputRedirection::processKeyboardKey(uint32_t key, InputRedirection::KeyboardKeyState state, uint32_t time)
|
void InputRedirection::processKeyboardKey(uint32_t key, InputRedirection::KeyboardKeyState state, uint32_t time)
|
||||||
{
|
{
|
||||||
Q_UNUSED(time)
|
|
||||||
#if HAVE_XKB
|
#if HAVE_XKB
|
||||||
m_xkb->updateKey(key, state);
|
m_xkb->updateKey(key, state);
|
||||||
// TODO: pass to internal parts of KWin
|
// TODO: pass to internal parts of KWin
|
||||||
|
@ -429,15 +428,27 @@ void InputRedirection::processKeyboardKey(uint32_t key, InputRedirection::Keyboa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// check unmanaged
|
#if HAVE_WAYLAND
|
||||||
if (!workspace()->unmanagedList().isEmpty()) {
|
if (auto seat = findSeat()) {
|
||||||
// TODO: better check whether this unmanaged should get the key event
|
seat->setTimestamp(time);
|
||||||
workspace()->unmanagedList().first()->sendKeybordKeyEvent(key, state);
|
// TODO: this needs better integration
|
||||||
return;
|
// check unmanaged
|
||||||
}
|
Toplevel *t = nullptr;
|
||||||
if (Client *client = workspace()->activeClient()) {
|
if (!workspace()->unmanagedList().isEmpty()) {
|
||||||
client->sendKeybordKeyEvent(key, state);
|
// TODO: better check whether this unmanaged should get the key event
|
||||||
|
t = workspace()->unmanagedList().first();
|
||||||
|
}
|
||||||
|
if (!t) {
|
||||||
|
t = workspace()->activeClient();
|
||||||
|
}
|
||||||
|
if (t && t->surface()) {
|
||||||
|
if (t->surface() != seat->focusedKeyboardSurface()) {
|
||||||
|
seat->setFocusedKeyboardSurface(t->surface());
|
||||||
|
}
|
||||||
|
state == InputRedirection::KeyboardKeyPressed ? seat->keyPressed(key) : seat->keyReleased(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputRedirection::processKeyboardModifiers(uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group)
|
void InputRedirection::processKeyboardModifiers(uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group)
|
||||||
|
|
Loading…
Reference in New Issue