Skip to content

fix: apply Live rendering changes during active effects - #15

Closed
Jah-yee wants to merge 1 commit into
sumimakito:mainfrom
Jah-yee:codex/live-rendering-toggle
Closed

Jah-yee wants to merge 1 commit into
sumimakito:mainfrom
Jah-yee:codex/live-rendering-toggle

Conversation

@Jah-yee

@Jah-yee Jah-yee commented Sep 11, 2026 •

Copy link
Copy Markdown

Problem

isLivePicture was only consulted when presentPicture() ran. Once an overlay was visible, changing Live rendering did not select a new picture source:

  • enabling it left the current held frame in place until the next lid cycle
  • disabling it left the live stream capturing and updating the overlay

Change

  • remember which picture source was selected for the current effect
  • reconcile that source with the preference during active polling
  • when it changes, stop the old display link and stream, discard the old live texture, and present the effect again with the selected source
  • explicitly start the stream when switching from a still picture to live rendering
  • invalidate older screenshot continuations so a rapid toggle cannot clear or present over the new source
  • generation-gate asynchronous stream setup so a stopped start cannot publish into a newer start

The existing screenshot and live-seeding paths are reused, so behavior outside a mid-effect setting change is unchanged.

Lifecycle edges

  • repeated live -> still -> live changes converge on the latest setting
  • stopping or sleeping invalidates pending presentation work
  • an older stream setup cannot clear a newer startTask, install its receiver, or invalidate the newer filter
  • failed setup remains retryable on the next normal start

The capture-cancellation behavior now on main is retained: disabling, sleeping, or stopping the app cancels the underlying screenshot. A normal animated effect end still only discards its cache, so this PR limits its additional guarantee to presentation state rather than changing ScreenSnapshotter ownership.

Validation

  • debug build with Swift warnings treated as errors
  • release build with Swift warnings treated as errors
  • git diff --check
  • exercised the generation guards against rapid source changes and stop/start ordering in code review
  • retained the cancellation guards from PR Makes the lid effect shut down more cleanly #3 while resolving the rebase onto current main

The change has not been exercised during a physical lid-close cycle.

Coordination

PR #16 also changes stream filter rebuilding, so the two PRs have a small textual conflict in ScreenStreamer. The tested resolution keeps this PR's cancellation and start-generation guards together with #16's fail-closed exclusion helper and post-rebuild filter readiness check.

@Jah-yee
Jah-yee force-pushed the codex/live-rendering-toggle branch from 56e5cf4 to 9c37f7c Compare September 11, 2026 14:19
@Jah-yee

Jah-yee commented Sep 17, 2026

Copy link
Copy Markdown
Author

Closing per Gate-2 (max 2 concurrent PRs per repo). #15 is mergeable_state=dirty with conflicts against #16. Keeping #16 and #17 as the primary clean PRs.

@Jah-yee Jah-yee closed this Sep 17, 2026
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