Files
ajp_anton d2a6aafc71 Support Plasma 6.8 unlock prompts across screen blanking
Keep prompt visibility separate from native authentication, reapply the patch after lock-screen file updates, and retain Plasma 6.7 compatibility. Add modern patch and visibility regression tests and document Fedora 45 package support.
2026-11-14 02:09:04 +00:00

54 lines
1.5 KiB
QML

// SPDX-License-Identifier: MIT
import QtQml
QtObject {
id: policy
required property QtObject window
required property QtObject screen
required property QtObject idleTimer
function reveal() {
if (window && window.visible && window.active) {
if ("seenPositionChange" in screen) {
screen.seenPositionChange = true;
}
screen.uiVisible = true;
}
}
Component.onCompleted: {
idleTimer.stop();
// Wait until the lock screen has finished constructing its authenticators.
Qt.callLater(reveal);
}
onWindowChanged: Qt.callLater(reveal)
property Connections visibilityChanges: Connections {
target: policy.window
function onVisibleChanged() { Qt.callLater(policy.reveal); }
function onActiveChanged() { Qt.callLater(policy.reveal); }
}
property Connections promptChanges: Connections {
target: policy.screen
function onUiVisibleChanged() {
// Escape powers off the display in the greeter itself. Keep the
// active screen's prompt ready for when the display wakes again.
if (!policy.screen.uiVisible) {
Qt.callLater(policy.reveal);
}
}
}
property Connections idleChanges: Connections {
target: policy.idleTimer
function onRunningChanged() {
if (policy.idleTimer.running) {
policy.idleTimer.stop();
}
}
}
}