fix flash on lockscreen

This commit is contained in:
2026-02-15 00:50:58 -08:00
parent 0d33436c77
commit 17d856a3e3

View File

@@ -15,32 +15,17 @@ WlSessionLock {
id: surface id: surface
color: "transparent" color: "transparent"
Component.onCompleted: console.log("done")
Rectangle { Rectangle {
id: content id: content
anchors.fill: parent anchors.fill: parent
visible: content.ready opacity: !lock.animate || capture.ready
readonly property bool ready: color: "#141414"
lock.animate &&
lock.secure &&
capture.hasContent
color: "#181818"
Text {
anchors {
horizontalCenter: parent.horizontalCenter
top: parent.top
topMargin: surface.height/12
}
color: "white"
font.pixelSize: 160
font.family: "Sriracha"
property var clock: SystemClock {}
text: `${clock.hours}:${clock.minutes}`
}
Rectangle { Rectangle {
anchors { anchors {
bottom: parent.bottom bottom: parent.bottom
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
bottomMargin: surface.height/6 bottomMargin: surface.height/6 - this.height/2
} }
width: 300 width: 300
height: 40 height: 40
@@ -63,7 +48,7 @@ WlSessionLock {
} }
Text { Text {
anchors { anchors {
horizontalCenter: input.horizontalCenter horizontalCenter: parent.horizontalCenter
top: parent.bottom top: parent.bottom
topMargin: 10 topMargin: 10
} }
@@ -75,10 +60,10 @@ WlSessionLock {
} }
ClippingRectangle { ClippingRectangle {
anchors.fill: parent anchors.fill: parent
color: "transparent" color: "white"
opacity: lock.animate
radius: 0 radius: 0
RectangularShadow { RectangularShadow {
visible: content.ready
anchors.fill: parent anchors.fill: parent
spread: 2 spread: 2
blur: 10 blur: 10
@@ -87,6 +72,11 @@ WlSessionLock {
id: capture id: capture
anchors.fill: parent anchors.fill: parent
captureSource: surface.screen captureSource: surface.screen
readonly property bool ready: {
lock.animate &&
lock.secure &&
capture.hasContent
}
Connections { Connections {
target: lock target: lock
function onLockedChanged() {capture.captureFrame()} function onLockedChanged() {capture.captureFrame()}
@@ -97,26 +87,26 @@ WlSessionLock {
xScale: 1 xScale: 1
yScale: xScale yScale: xScale
NumberAnimation on xScale { NumberAnimation on xScale {
running: content.ready running: capture.ready
to: 0.85 to: 0.80
duration: 800 duration: 800
easing.type: Easing.InQuint easing.type: Easing.InQuint
} }
NumberAnimation on xScale { NumberAnimation on xScale {
id: exit id: exit
running: false running: false
from: 0.85 from: 0.8
to: 1 to: 1
duration: 800 duration: 800
easing.type: Easing.OutQuint easing.type: Easing.OutQuint
onFinished: { onStarted: {
content.visible = false capture.parent.visible = true
fadeOut.start()
} }
onFinished: lock.locked = false
} }
} }
SequentialAnimation on opacity { SequentialAnimation on opacity {
running: content.ready running: capture.ready
PauseAnimation {duration: 500} PauseAnimation {duration: 500}
NumberAnimation { NumberAnimation {
duration: 300 duration: 300
@@ -130,7 +120,7 @@ WlSessionLock {
to: 1 to: 1
} }
NumberAnimation on radius { NumberAnimation on radius {
running: content.ready running: capture.ready
duration: 800 duration: 800
to: 32 to: 32
} }
@@ -139,13 +129,6 @@ WlSessionLock {
to: 0 to: 0
duration: 800 duration: 800
} }
NumberAnimation on opacity {
id: fadeOut
running: false
to: 0
duration: 150
onFinished: lock.locked = false
}
} }
PamContext { PamContext {
id: pam id: pam