Skip to content

Commit 42b7b43

Browse files
committed
[L&F] fix first keystroke capture on LockScreen #149
1 parent e0750e5 commit 42b7b43

File tree

3 files changed

+15
-24
lines changed

3 files changed

+15
-24
lines changed

plasma/look-and-feel/com.github.varlesh.materia-dark/contents/lockscreen/LockScreenUi.qml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,10 @@ PlasmaCore.ColorScope {
6464
function onPrompt(msg) {
6565
root.notification = msg;
6666
mainBlock.echoMode = TextInput.Normal
67-
mainBlock.mainPasswordBox.text = "";
6867
mainBlock.mainPasswordBox.forceActiveFocus();
6968
}
7069
function onPromptForSecret(msg) {
7170
mainBlock.echoMode = TextInput.Password
72-
mainBlock.mainPasswordBox.text = "";
7371
mainBlock.mainPasswordBox.forceActiveFocus();
7472
}
7573
}
@@ -141,12 +139,8 @@ PlasmaCore.ColorScope {
141139
if (blockUI) {
142140
fadeoutTimer.running = false;
143141
} else if (uiVisible) {
144-
mainBlock.mainPasswordBox.forceActiveFocus();
145142
fadeoutTimer.restart();
146143
}
147-
if (!uiVisible) {
148-
lockScreenRoot.forceActiveFocus();
149-
}
150144
if (!calledUnlock) {
151145
calledUnlock = true
152146
authenticator.tryUnlock();
@@ -163,7 +157,7 @@ PlasmaCore.ColorScope {
163157
Keys.onEscapePressed: {
164158
uiVisible = !uiVisible;
165159
if (!uiVisible) {
166-
mainBlock.mainPasswordBox.text = "";
160+
root.clearPassword();
167161
}
168162
}
169163
Keys.onPressed: {
@@ -188,7 +182,10 @@ PlasmaCore.ColorScope {
188182
Timer {
189183
id: graceLockTimer
190184
interval: 3000
191-
onTriggered: authenticator.tryUnlock();
185+
onTriggered: {
186+
root.clearPassword();
187+
authenticator.tryUnlock();
188+
}
192189
}
193190

194191
Component.onCompleted: PropertyAnimation { id: launchAnimation; target: lockScreenRoot; property: "opacity"; from: 0; to: 1; duration: 1000 }

plasma/look-and-feel/com.github.varlesh.materia-light/contents/lockscreen/LockScreenUi.qml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,10 @@ PlasmaCore.ColorScope {
6464
function onPrompt(msg) {
6565
root.notification = msg;
6666
mainBlock.echoMode = TextInput.Normal
67-
mainBlock.mainPasswordBox.text = "";
6867
mainBlock.mainPasswordBox.forceActiveFocus();
6968
}
7069
function onPromptForSecret(msg) {
7170
mainBlock.echoMode = TextInput.Password
72-
mainBlock.mainPasswordBox.text = "";
7371
mainBlock.mainPasswordBox.forceActiveFocus();
7472
}
7573
}
@@ -141,11 +139,7 @@ PlasmaCore.ColorScope {
141139
if (blockUI) {
142140
fadeoutTimer.running = false;
143141
} else if (uiVisible) {
144-
mainBlock.mainPasswordBox.forceActiveFocus();
145142
fadeoutTimer.restart();
146-
if (!uiVisible) {
147-
lockScreenRoot.forceActiveFocus();
148-
}
149143
}
150144
if (!calledUnlock) {
151145
calledUnlock = true
@@ -163,7 +157,7 @@ PlasmaCore.ColorScope {
163157
Keys.onEscapePressed: {
164158
uiVisible = !uiVisible;
165159
if (!uiVisible) {
166-
mainBlock.mainPasswordBox.text = "";
160+
root.clearPassword();
167161
}
168162
}
169163
Keys.onPressed: {
@@ -188,7 +182,10 @@ PlasmaCore.ColorScope {
188182
Timer {
189183
id: graceLockTimer
190184
interval: 3000
191-
onTriggered: authenticator.tryUnlock();
185+
onTriggered: {
186+
root.clearPassword();
187+
authenticator.tryUnlock();
188+
}
192189
}
193190

194191
Component.onCompleted: PropertyAnimation { id: launchAnimation; target: lockScreenRoot; property: "opacity"; from: 0; to: 1; duration: 1000 }

plasma/look-and-feel/com.github.varlesh.materia/contents/lockscreen/LockScreenUi.qml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,10 @@ PlasmaCore.ColorScope {
6464
function onPrompt(msg) {
6565
root.notification = msg;
6666
mainBlock.echoMode = TextInput.Normal
67-
mainBlock.mainPasswordBox.text = "";
6867
mainBlock.mainPasswordBox.forceActiveFocus();
6968
}
7069
function onPromptForSecret(msg) {
7170
mainBlock.echoMode = TextInput.Password
72-
mainBlock.mainPasswordBox.text = "";
7371
mainBlock.mainPasswordBox.forceActiveFocus();
7472
}
7573
}
@@ -141,12 +139,8 @@ PlasmaCore.ColorScope {
141139
if (blockUI) {
142140
fadeoutTimer.running = false;
143141
} else if (uiVisible) {
144-
mainBlock.mainPasswordBox.forceActiveFocus();
145142
fadeoutTimer.restart();
146143
}
147-
if (!uiVisible) {
148-
lockScreenRoot.forceActiveFocus();
149-
}
150144
if (!calledUnlock) {
151145
calledUnlock = true
152146
authenticator.tryUnlock();
@@ -163,7 +157,7 @@ PlasmaCore.ColorScope {
163157
Keys.onEscapePressed: {
164158
uiVisible = !uiVisible;
165159
if (!uiVisible) {
166-
mainBlock.mainPasswordBox.text = "";
160+
root.clearPassword();
167161
}
168162
}
169163
Keys.onPressed: {
@@ -188,7 +182,10 @@ PlasmaCore.ColorScope {
188182
Timer {
189183
id: graceLockTimer
190184
interval: 3000
191-
onTriggered: authenticator.tryUnlock();
185+
onTriggered: {
186+
root.clearPassword();
187+
authenticator.tryUnlock();
188+
}
192189
}
193190

194191
Component.onCompleted: PropertyAnimation { id: launchAnimation; target: lockScreenRoot; property: "opacity"; from: 0; to: 1; duration: 1000 }

0 commit comments

Comments
 (0)