Merge pull request #7806 from berndb/lock-ignore-autorepeat
Drop key auto-repeat in the lock screen password field
This commit is contained in:
3 files changed
+158
No files matched your search
@@ -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
|
||||
@@ -199,6 +207,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
|
||||
|
||||
Reference in new issue
Block a user