Skip to content

perf(background): fix micro-stutter at start of wallpaper transition - #96

Open
TerraEgg wants to merge 1 commit into
pctrade:mainfrom
TerraEgg:perf/wallpaper-transition-smoothness
Open

perf(background): fix micro-stutter at start of wallpaper transition#96
TerraEgg wants to merge 1 commit into
pctrade:mainfrom
TerraEgg:perf/wallpaper-transition-smoothness

Conversation

@TerraEgg

@TerraEgg TerraEgg commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Problem

Changing wallpapers causes a noticeable 100-250ms freeze at the start of the transition before the animation starts moving.

Cause

  1. onWallpaperPathChanged sets transitionProgress = 0.0 immediately, which makes transitionEffect visible right away. Because wallpaper loads asynchronously (asynchronous: true), transitionAnim has to wait for wallpaper.status === Image.Ready. This leaves the shader frozen on screen at progress 0 while the image decodes.
  2. Easing.InOutCubic over 1200ms has a flat curve at the start, making the initial movement feel sluggish.

Changes

  • Added a transitionPending flag. transitionProgress stays at 1.0 while the new wallpaper decodes in the background, keeping the current wallpaper visible on screen without showing a paused shader.
  • When wallpaper.status === Image.Ready, transitionProgress is set to 0.0 and transitionAnim.restart() fires at the same time.
  • Switched transition easing to Easing.InOutQuad with a 1000ms duration for a smoother start.

Builds on #95.

Testing

Tested on a 165Hz display switching between large wallpapers. The transition starts immediately once the image is decoded with no pause on frame 0.

…smoothness

- Introduce transitionPending to prevent premature ShaderEffect activation while asynchronous image decoding is underway
- Keep current wallpaper visible without interruption until the new wallpaper is fully ready in memory
- Switch animation easing from InOutCubic to InOutQuad (1000ms) to eliminate the flat hesitation zone at start
@TerraEgg
TerraEgg force-pushed the perf/wallpaper-transition-smoothness branch from d9d8140 to 7f21d8f Compare September 9, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant