fix(background): fix dupe transition on startup + minor safety improvement to avoid potential null texture on shaders

This commit is contained in:
Lemmy
2026-03-25 16:19:47 -04:00
parent de4e087363
commit 7966f963dc
+15 -8
View File
@@ -231,7 +231,7 @@ Variants {
anchors.fill: parent anchors.fill: parent
property variant source1: currentWallpaper property variant source1: currentWallpaper
property variant source2: nextWallpaper property variant source2: nextWallpaper.status === Image.Ready ? nextWallpaper : currentWallpaper.status === Image.Ready ? nextWallpaper : currentWallpaper
property real progress: root.transitionProgress property real progress: root.transitionProgress
// Fill mode properties // Fill mode properties
@@ -261,7 +261,7 @@ Variants {
anchors.fill: parent anchors.fill: parent
property variant source1: currentWallpaper property variant source1: currentWallpaper
property variant source2: nextWallpaper property variant source2: nextWallpaper.status === Image.Ready ? nextWallpaper : currentWallpaper
property real progress: root.transitionProgress property real progress: root.transitionProgress
property real smoothness: root.edgeSmoothness property real smoothness: root.edgeSmoothness
property real direction: root.wipeDirection property real direction: root.wipeDirection
@@ -293,7 +293,7 @@ Variants {
anchors.fill: parent anchors.fill: parent
property variant source1: currentWallpaper property variant source1: currentWallpaper
property variant source2: nextWallpaper property variant source2: nextWallpaper.status === Image.Ready ? nextWallpaper : currentWallpaper
property real progress: root.transitionProgress property real progress: root.transitionProgress
property real smoothness: root.edgeSmoothness property real smoothness: root.edgeSmoothness
property real aspectRatio: root.width / root.height property real aspectRatio: root.width / root.height
@@ -327,7 +327,7 @@ Variants {
anchors.fill: parent anchors.fill: parent
property variant source1: currentWallpaper property variant source1: currentWallpaper
property variant source2: nextWallpaper property variant source2: nextWallpaper.status === Image.Ready ? nextWallpaper : currentWallpaper
property real progress: root.transitionProgress property real progress: root.transitionProgress
property real smoothness: root.edgeSmoothness property real smoothness: root.edgeSmoothness
property real aspectRatio: root.width / root.height property real aspectRatio: root.width / root.height
@@ -361,7 +361,7 @@ Variants {
anchors.fill: parent anchors.fill: parent
property variant source1: currentWallpaper property variant source1: currentWallpaper
property variant source2: nextWallpaper property variant source2: nextWallpaper.status === Image.Ready ? nextWallpaper : currentWallpaper
property real progress: root.transitionProgress property real progress: root.transitionProgress
property real maxBlockSize: root.pixelateMaxBlockSize property real maxBlockSize: root.pixelateMaxBlockSize
@@ -392,7 +392,7 @@ Variants {
anchors.fill: parent anchors.fill: parent
property variant source1: currentWallpaper property variant source1: currentWallpaper
property variant source2: nextWallpaper property variant source2: nextWallpaper.status === Image.Ready ? nextWallpaper : currentWallpaper
property real progress: root.transitionProgress property real progress: root.transitionProgress
property real cellSize: root.honeycombCellSize property real cellSize: root.honeycombCellSize
property real centerX: root.honeycombCenterX property real centerX: root.honeycombCenterX
@@ -429,6 +429,12 @@ Variants {
duration: Settings.data.wallpaper.transitionDuration duration: Settings.data.wallpaper.transitionDuration
easing.type: Easing.InOutCubic easing.type: Easing.InOutCubic
onFinished: { onFinished: {
// Mark startup complete now that the animation has finished,
// so displayScalesChanged doesn't trigger a duplicate transition.
if (isStartupTransition) {
isStartupTransition = false;
}
// Clear the tracking of what we're transitioning to // Clear the tracking of what we're transitioning to
transitioningToOriginalPath = ""; transitioningToOriginalPath = "";
@@ -783,11 +789,12 @@ Variants {
function _executeStartupTransition() { function _executeStartupTransition() {
if (transitionType === "none") { if (transitionType === "none") {
setWallpaperImmediate(futureWallpaper); setWallpaperImmediate(futureWallpaper);
isStartupTransition = false;
} else { } else {
// isStartupTransition stays true until transitionAnimation.onFinished
// to prevent displayScalesChanged from triggering a duplicate transition.
setWallpaperWithTransition(futureWallpaper); setWallpaperWithTransition(futureWallpaper);
} }
// Mark startup transition complete
isStartupTransition = false;
} }
} }
} }