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.
This commit is contained in:
ajp_anton committed 2026-11-14 02:09:04 +00:00
1 parent 851e0d1d24
commit d2a6aafc71
10 files changed
+871 -38

No files matched your search

@@ -0,0 +1,106 @@
// SPDX-License-Identifier: MIT
import QtQml
import QtTest
import ".."
TestCase {
name: "UnlockPrompt"
QtObject {
id: window
property bool visible: false
property bool active: false
}
QtObject {
id: screen
property bool uiVisible: false
property bool seenPositionChange: false
onUiVisibleChanged: {
if (uiVisible) idle.restart();
}
}
Timer {
id: idle
interval: 20
onTriggered: screen.uiVisible = false
}
FedoraToolsUnlockPrompt {
id: policy
window: window
screen: screen
idleTimer: idle
}
function init() {
window.visible = false;
window.active = false;
screen.uiVisible = false;
screen.seenPositionChange = false;
policy.window = window;
}
function test_revealOnWake() {
window.visible = true;
window.active = true;
tryCompare(screen, "uiVisible", true);
verify(screen.seenPositionChange);
verify(!idle.running);
wait(60);
verify(screen.uiVisible);
}
function test_idleDoesNotHidePrompt() {
window.visible = true;
window.active = true;
tryCompare(screen, "uiVisible", true);
idle.restart();
verify(!idle.running);
wait(60);
verify(screen.uiVisible);
}
function test_escapeKeepsPromptReadyForDisplayWake() {
window.visible = true;
window.active = true;
tryCompare(screen, "uiVisible", true);
screen.uiVisible = false; // Native Escape handling hides before powering off.
tryCompare(screen, "uiVisible", true);
verify(!idle.running);
}
function test_inactiveScreenStaysHidden() {
window.visible = true;
window.active = true;
tryCompare(screen, "uiVisible", true);
window.active = false;
screen.uiVisible = false;
wait(60);
verify(!screen.uiVisible);
window.active = true;
tryCompare(screen, "uiVisible", true);
}
function test_focusChangesBeforeDeferredReveal() {
window.visible = true;
window.active = true;
window.active = false;
wait(60);
verify(!screen.uiVisible);
}
function test_hiddenViewStaysHidden() {
wait(40);
verify(!screen.uiVisible);
}
function test_windowAttachedAfterItIsShown() {
policy.window = null;
wait(40);
verify(!screen.uiVisible);
window.visible = true;
window.active = true;
policy.window = window;
tryCompare(screen, "uiVisible", true);
}
}