Unset focused keyboard surface when screen is locked

If the screen is locked and no lock screen is shown yet we unset
the focused keyboard surface on key event. Similar we restore when
screen is unlocked.

This should hopefully fix the broken lockscreen unit test which hits
the special condition as the greeter doesn't show up on build.kde.org.
icc-effect-5.14.5
Martin Gräßlin 2016-02-09 08:45:29 +01:00
parent 09cc134bfc
commit a47b6f9435
1 changed files with 9 additions and 0 deletions

View File

@ -983,6 +983,11 @@ void InputRedirection::processKeyboardKey(uint32_t key, InputRedirection::Keyboa
}
return;
} while (it != stacking.begin());
if (auto seat = findSeat()) {
seat->setFocusedKeyboardSurface(nullptr);
seat->setTimestamp(time);
state == InputRedirection::KeyboardKeyPressed ? seat->keyPressed(key) : seat->keyReleased(key);
}
return;
}
@ -1035,6 +1040,10 @@ void InputRedirection::processKeyboardKey(uint32_t key, InputRedirection::Keyboa
}
}
if (auto seat = findSeat()) {
if (workspace()->activeClient() &&
(seat->focusedKeyboardSurface() != workspace()->activeClient()->surface())) {
seat->setFocusedKeyboardSurface(workspace()->activeClient()->surface());
}
seat->setTimestamp(time);
state == InputRedirection::KeyboardKeyPressed ? seat->keyPressed(key) : seat->keyReleased(key);
}