Delay session lock during display hotplug
This commit is contained in:
@@ -51,11 +51,19 @@ Item {
|
|||||||
return realScreenCount() > 0
|
return realScreenCount() > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function queueSessionLock() {
|
||||||
|
pendingSessionLock = true
|
||||||
|
if (!sessionLockStabilizeTimer.running) logEvent("lock-pending: screen-stabilizing")
|
||||||
|
sessionLockStabilizeTimer.restart()
|
||||||
|
if (!pendingSessionLockTimer.running) pendingSessionLockTimer.start()
|
||||||
|
}
|
||||||
|
|
||||||
function requestSessionLock() {
|
function requestSessionLock() {
|
||||||
if (!lockRequested || sessionLock.locked || sessionLock.secure) return
|
if (!lockRequested || sessionLock.locked || sessionLock.secure) return
|
||||||
|
if (sessionLockStabilizeTimer.running) return
|
||||||
|
|
||||||
if (!hasRealScreen()) {
|
if (!hasRealScreen()) {
|
||||||
if (!pendingSessionLock) logEvent("lock-pending: no-real-screen")
|
if (!pendingSessionLock || lastEvent !== "lock-pending: no-real-screen") logEvent("lock-pending: no-real-screen")
|
||||||
pendingSessionLock = true
|
pendingSessionLock = true
|
||||||
if (!pendingSessionLockTimer.running) pendingSessionLockTimer.start()
|
if (!pendingSessionLockTimer.running) pendingSessionLockTimer.start()
|
||||||
return
|
return
|
||||||
@@ -102,7 +110,7 @@ Item {
|
|||||||
lockRequested = true
|
lockRequested = true
|
||||||
idleBlankTimer.restart()
|
idleBlankTimer.restart()
|
||||||
logEvent("lock-requested")
|
logEvent("lock-requested")
|
||||||
requestSessionLock()
|
queueSessionLock()
|
||||||
|
|
||||||
Qt.callLater(function() {
|
Qt.callLater(function() {
|
||||||
root.refreshBackground()
|
root.refreshBackground()
|
||||||
@@ -117,6 +125,7 @@ Item {
|
|||||||
|
|
||||||
lockRequested = false
|
lockRequested = false
|
||||||
pendingSessionLock = false
|
pendingSessionLock = false
|
||||||
|
sessionLockStabilizeTimer.stop()
|
||||||
pendingSessionLockTimer.stop()
|
pendingSessionLockTimer.stop()
|
||||||
resetAuthenticationState()
|
resetAuthenticationState()
|
||||||
idleBlankTimer.stop()
|
idleBlankTimer.stop()
|
||||||
@@ -197,6 +206,7 @@ Item {
|
|||||||
root.logEvent("secure=" + secure)
|
root.logEvent("secure=" + secure)
|
||||||
if (secure) {
|
if (secure) {
|
||||||
root.pendingSessionLock = false
|
root.pendingSessionLock = false
|
||||||
|
sessionLockStabilizeTimer.stop()
|
||||||
pendingSessionLockTimer.stop()
|
pendingSessionLockTimer.stop()
|
||||||
root.startFingerprint()
|
root.startFingerprint()
|
||||||
}
|
}
|
||||||
@@ -207,12 +217,14 @@ Item {
|
|||||||
|
|
||||||
if (locked) {
|
if (locked) {
|
||||||
root.pendingSessionLock = false
|
root.pendingSessionLock = false
|
||||||
|
sessionLockStabilizeTimer.stop()
|
||||||
pendingSessionLockTimer.stop()
|
pendingSessionLockTimer.stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!locked && root.lockRequested) {
|
if (!locked && root.lockRequested) {
|
||||||
root.lockRequested = false
|
root.lockRequested = false
|
||||||
root.pendingSessionLock = false
|
root.pendingSessionLock = false
|
||||||
|
sessionLockStabilizeTimer.stop()
|
||||||
pendingSessionLockTimer.stop()
|
pendingSessionLockTimer.stop()
|
||||||
root.resetAuthenticationState()
|
root.resetAuthenticationState()
|
||||||
root.runWake()
|
root.runWake()
|
||||||
@@ -361,6 +373,13 @@ Item {
|
|||||||
onTriggered: if (root.lockRequested && !root.authenticating) root.runBlank()
|
onTriggered: if (root.lockRequested && !root.authenticating) root.runBlank()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: sessionLockStabilizeTimer
|
||||||
|
interval: 500
|
||||||
|
repeat: false
|
||||||
|
onTriggered: root.requestSessionLock()
|
||||||
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: pendingSessionLockTimer
|
id: pendingSessionLockTimer
|
||||||
interval: 100
|
interval: 100
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ grep -F '(( attempt % 5 == 0 )) && recover_internal_monitor_toggles' "$sleep_loc
|
|||||||
pass "sleep lock recovers internal monitor toggles while waiting for secure lock"
|
pass "sleep lock recovers internal monitor toggles while waiting for secure lock"
|
||||||
|
|
||||||
grep -F 'lock-pending: no-real-screen' "$lock_service" >/dev/null
|
grep -F 'lock-pending: no-real-screen' "$lock_service" >/dev/null
|
||||||
|
grep -F 'lock-pending: screen-stabilizing' "$lock_service" >/dev/null
|
||||||
|
grep -F 'id: sessionLockStabilizeTimer' "$lock_service" >/dev/null
|
||||||
grep -F 'function onScreensChanged() { root.requestSessionLock() }' "$lock_service" >/dev/null
|
grep -F 'function onScreensChanged() { root.requestSessionLock() }' "$lock_service" >/dev/null
|
||||||
grep -F 'realScreens: root.realScreenCount()' "$lock_service" >/dev/null
|
grep -F 'realScreens: root.realScreenCount()' "$lock_service" >/dev/null
|
||||||
pass "lock service defers session lock until a real screen exists"
|
pass "lock service waits for stable real screens before session lock"
|
||||||
|
|||||||
Reference in New Issue
Block a user