Drop key auto-repeat in the lock screen password field

This commit is contained in:
Bernd Behler committed 2026-08-22 20:18:52 +02:00
1 parent eca89f9518
commit 6e15d76a62
3 files changed
+158

No files matched your search

+12
View File
@@ -60,6 +60,14 @@ Item {
passwordTextEdited("")
}
// Waking a DPMS-blanked display can stall the compositor for seconds while
// the monitor modesets, so the wake key's release arrives late and client-side
// key repeat floods the field with that character. A held key has no business
// typing a password; only holding Backspace/Delete to clear stays useful.
function dropsAutoRepeat(key) {
return key !== Qt.Key_Backspace && key !== Qt.Key_Delete
}
function syncPasswordText() {
if (passwordInput.text === passwordText) return
syncingPasswordText = true
@@ -176,6 +184,10 @@ Item {
Keys.onPressed: function(event) {
root.wakeRequested()
if (event.isAutoRepeat && root.dropsAutoRepeat(event.key)) {
event.accepted = true
return
}
if (event.key === Qt.Key_Escape || (event.modifiers & Qt.ControlModifier && event.key === Qt.Key_U)) {
root.passwordTextEdited("")
event.accepted = true