Only send key press events to the moving client

The invoked method is called keyPressEvent, thus it should not get
key release events. Before each key event was handled twice.
This commit is contained in:
Martin Gräßlin 2016-01-29 09:52:01 +01:00
parent 2a935c523f
commit bdb423da3d

View file

@ -1004,10 +1004,13 @@ void InputRedirection::processKeyboardKey(uint32_t key, InputRedirection::Keyboa
}
if (workspace()) {
if (AbstractClient *c = workspace()->getMovingClient()) {
c->keyPressEvent(m_xkb->toQtKey(m_xkb->toKeysym(key)) | m_xkb->modifiers());
if (c->isMove() || c->isResize()) {
// only update if mode didn't end
c->updateMoveResize(m_globalPointer);
// TODO: handle key repeat
if (state == KeyboardKeyPressed) {
c->keyPressEvent(m_xkb->toQtKey(m_xkb->toKeysym(key)) | m_xkb->modifiers());
if (c->isMove() || c->isResize()) {
// only update if mode didn't end
c->updateMoveResize(m_globalPointer);
}
}
return;
}