Skip to content

Lock screen: Prevent Escape key from displaying UI if it's currently hidden

Nate Graham requested to merge work/cherry-pick-8879fefe into Plasma/5.27

Merge request kscreenlocker!99 (merged) implemented turning off the screen when the Escape key is pressed on the lock screen. However, the lock screen UI logic was not updated to take this into account.

There are two behaviors to consider here. The first is such that pressing the Escape key on the password prompt clears the entry and hides the UI. This is expected and works well in conjunction with the screen going off. When the user returns to the computer after a while and tries to log in again, they would not expect to see a partially typed password. Or, even worse, the user might enter the password and then press the Escape key. If the previous entry were left as entered, unbeknownst to the user, an adversary could gain access to the user's account.

The second behavior is when the password entry UI is not displayed. In this case, the UI logic reacted by displaying the password entry prompt. While this behavior may have been fine before, with the change to turn off the screen, this looks like some sort of bug.

This commit disables Escape key handling when the password entry UI is not visible.

BUG: 465920 FIXED-IN: 5.27.2

(cherry picked from commit 8879fefe)

Merge request reports