From 13057013d55ae19e76d29b9edc96510e52da2a7a Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 8 Jan 2021 12:40:07 +0000 Subject: [PATCH] [lookandfeel] Fix wake existing screensaver mode with key presses In commit 45e0a722fb85bb5d1ab8bef92080e934254b13aa we changed the focus on the textfield with the intention of fixing the cusor blinking. This had the unfortunate side effect of breaking waking out of the screensaver mode with just the keyboard. That screensaver mode was bound to: ``` property bool blockUI: mainBlock.mainPasswordBox.text.length > 0 ``` for that to change, we need to have focus. Instead this patches cursor blinking more explicity. Doing it only in the lock screen (as opposed to the toolkit) makes sense as this only happens due to somewhat unusual usage inside the lockscreen. BUG: 431286 (cherry picked from commit 2cbd7e4c70d0592d16cdaf58ed43effe4a716aa4) --- lookandfeel/contents/lockscreen/LockScreenUi.qml | 3 --- lookandfeel/contents/lockscreen/MainBlock.qml | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lookandfeel/contents/lockscreen/LockScreenUi.qml b/lookandfeel/contents/lockscreen/LockScreenUi.qml index d2f8a2b7d..c4f9e8a45 100644 --- a/lookandfeel/contents/lockscreen/LockScreenUi.qml +++ b/lookandfeel/contents/lockscreen/LockScreenUi.qml @@ -229,9 +229,6 @@ PlasmaCore.ColorScope { // this isn't implicit, otherwise items still get processed for the scenegraph visible: opacity > 0 - // changing enabled will toggle if an item can have activeFocus, which otherwise - //keeps the text cursor blinking even when invisble - enabled: visible initialItem: MainBlock { id: mainBlock diff --git a/lookandfeel/contents/lockscreen/MainBlock.qml b/lookandfeel/contents/lockscreen/MainBlock.qml index 4bd5df0e5..e8f5ced47 100644 --- a/lookandfeel/contents/lockscreen/MainBlock.qml +++ b/lookandfeel/contents/lockscreen/MainBlock.qml @@ -66,6 +66,12 @@ SessionManagementScreen { enabled: !authenticator.graceLocked revealPasswordButtonShown: true + // In Qt this is implicitly active based on focus rather than visibility + // in any other application having a focussed invisible object would be weird + // but here we are using to wake out of screensaver mode + // We need to explicitly disable cursor flashing to avoid unnecessary renders + cursorVisible: visible + onAccepted: { if (lockScreenUiVisible) { startLogin(); -- GitLab