11import QtQuick
22import QtQuick.Effects
33import Quickshell
4+ import Quickshell.Wayland
45import qs.Commons
56import qs.Services.Compositor
67import qs.Services.Power
@@ -10,11 +11,18 @@ Item {
1011 id: root
1112 anchors .fill : parent
1213
14+ required property ShellScreen screen
15+
1316 // Cached wallpaper path - exposed for parent components
1417 property string resolvedWallpaperPath: " "
15- property color tintColor: Settings .data .colorSchemes .darkMode ? Color .mSurface : Color .mOnSurface
1618
17- required property var screen
19+ // Enter / exit transtion value
20+ property real transitionProgress: 1.0
21+
22+ readonly property color tintColor: Settings .data .colorSchemes .darkMode ? Color .mSurface : Color .mOnSurface
23+ readonly property bool useEffects: ! PowerProfileService .noctaliaPerformanceMode || ! Settings .data .noctaliaPerformance .disableWallpaper
24+ readonly property bool useScreencopy: Settings .data .general .lockScreenCopyBg
25+ readonly property bool useWallpaper: Settings .data .wallpaper .enabled && resolvedWallpaperPath !== " "
1826
1927 // Request preprocessed wallpaper when lock screen becomes active or dimensions change
2028 Component .onCompleted : {
@@ -103,35 +111,56 @@ Item {
103111 });
104112 }
105113
106- // Background - solid color or black fallback
114+ // Opaque black at the very bottom to prevent white flash
107115 Rectangle {
108116 anchors .fill : parent
109- color: Settings . data . wallpaper . useSolidColor ? Settings . data . wallpaper . solidColor : " #000000 "
117+ color: " black "
110118 }
111119
120+ // A copy of the screen to use as background
121+ // Also used as fade in / fade out backdrop
122+ ScreencopyView {
123+ id: lockBgScreencopy
124+ visible: useEffects && (useScreencopy || useWallpaper)
125+ anchors .fill : parent
126+ captureSource: screen
127+ }
128+
129+ // If using a solid color wallpaper
130+ Rectangle {
131+ anchors .fill : parent
132+ opacity: (Settings .data .wallpaper .useSolidColor && useEffects) ? transitionProgress : 0.0
133+ color: Settings .data .wallpaper .solidColor
134+ }
135+
136+ // If using an image wallpaper
112137 Image {
113138 id: lockBgImage
114- visible: source !== " " && Settings . data . wallpaper . enabled && ! Settings . data . wallpaper . useSolidColor && ( ! PowerProfileService . noctaliaPerformanceMode || ! Settings . data . noctaliaPerformance . disableWallpaper )
139+ visible: false // rendered with effects below
115140 anchors .fill : parent
116141 fillMode: Image .PreserveAspectCrop
117142 source: resolvedWallpaperPath
118143 cache: false
119144 smooth: true
120145 mipmap: false
121146 antialiasing: true
147+ }
122148
123- layer .enabled : Settings .data .general .lockScreenBlur > 0 && ! PowerProfileService .noctaliaPerformanceMode
124- layer .smooth : false
125- layer .effect : MultiEffect {
126- blurEnabled: true
127- blur: Settings .data .general .lockScreenBlur
128- blurMax: 48
129- }
149+ // Applies the image wallpaper or screen copy with effects
150+ MultiEffect {
151+ id: lockBgRender
152+ anchors .fill : parent
153+ opacity: transitionProgress
154+ visible: useEffects && (useScreencopy || useWallpaper)
155+ source: useScreencopy ? lockBgScreencopy : lockBgImage
156+
157+ blurEnabled: Settings .data .general .lockScreenBlur > 0
158+ blur: Settings .data .general .lockScreenBlur
159+ blurMax: 128
130160
131- // Tint overlay
132161 Rectangle {
133162 anchors .fill : parent
134- color: root . tintColor
163+ color: tintColor
135164 opacity: Settings .data .general .lockScreenTint
136165 }
137166 }
0 commit comments