[wayland] Pass keyboard key press/released events to SeatInterface

Improves handling by no longer sending events with xtest.
icc-effect-5.14.5
Martin Gräßlin 2015-02-26 16:06:48 +01:00
parent c29f96665d
commit 7bb107ba6d
1 changed files with 20 additions and 9 deletions

View File

@ -395,7 +395,6 @@ void InputRedirection::processPointerAxis(InputRedirection::PointerAxis axis, qr
void InputRedirection::processKeyboardKey(uint32_t key, InputRedirection::KeyboardKeyState state, uint32_t time)
{
Q_UNUSED(time)
#if HAVE_XKB
m_xkb->updateKey(key, state);
// TODO: pass to internal parts of KWin
@ -429,15 +428,27 @@ void InputRedirection::processKeyboardKey(uint32_t key, InputRedirection::Keyboa
}
}
#endif
// check unmanaged
if (!workspace()->unmanagedList().isEmpty()) {
// TODO: better check whether this unmanaged should get the key event
workspace()->unmanagedList().first()->sendKeybordKeyEvent(key, state);
return;
}
if (Client *client = workspace()->activeClient()) {
client->sendKeybordKeyEvent(key, state);
#if HAVE_WAYLAND
if (auto seat = findSeat()) {
seat->setTimestamp(time);
// TODO: this needs better integration
// check unmanaged
Toplevel *t = nullptr;
if (!workspace()->unmanagedList().isEmpty()) {
// 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)