Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0020f9b
Add Psychedelic and Liquid background layers with Metal shaders
ppamorim Feb 28, 2026
946cc80
Fix star artifact in Liquid and Psychedelic Metal shaders
ppamorim Feb 28, 2026
cd206bb
Add PuppyLayer with animated Apple logo tunnel zoom effect
ppamorim Feb 28, 2026
84edccd
Add WarpLayer with speed-of-light particle simulation
ppamorim Feb 28, 2026
cd7639d
Fix Metal layer resolution on resize and WarpLayer scaling
ppamorim Feb 28, 2026
2f712f9
Improve WarpLayer speed dynamics and easing curves
ppamorim Feb 28, 2026
1448bfb
Add relativistic physics to WarpLayer and update docs for 1.3.4
ppamorim Feb 28, 2026
b918387
Add per-layer depth noise to WarpLayer star field
ppamorim Feb 28, 2026
ca0d2be
Increase idle star brightness in WarpLayer
ppamorim Feb 28, 2026
a53e406
Revert FruitScreensaver.swift to restore multi-screen rendering
ppamorim Feb 28, 2026
1edef15
Optimize WarpLayer shader: cache uniforms on CPU, reduce GPU ALU
ppamorim Feb 28, 2026
9ccb94d
Fix diagonal line artifact in warp shader and add early brightness exit
ppamorim Mar 1, 2026
222413f
Add scissor rect rendering optimization to all Metal background layers
ppamorim Mar 1, 2026
42461fc
Add Irish Ocean background layer with Metal shader
ppamorim Mar 1, 2026
13ada25
Add debug stats overlay (FPS, CPU, GPU) and fix Metal layer init copies
ppamorim Mar 1, 2026
804b60e
Correct PreferencesViewController and DisplayLink animator configuration
ppamorim May 15, 2026
019c24e
Add POGO, Glue, Metallic and improved Irish Ocean layers
ppamorim May 16, 2026
a0fa0c9
Remove debug view
ppamorim May 16, 2026
cc60b17
Add leaf to height matrix calculation
ppamorim May 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,28 @@

set -e

INSTALL_DIR="$HOME/Library/Screen Savers"
SAVER_NAME="Fruit.saver"

rm -rf build/Fruit.xcarchive build/"$SAVER_NAME"

xcodebuild -scheme Fruit -configuration Release -archivePath build/Fruit.xcarchive archive

SAVER_SRC=$(find build/Fruit.xcarchive/Products -type d -name "Fruit.saver" | head -n 1)
SAVER_SRC=$(find build/Fruit.xcarchive/Products -type d -name "$SAVER_NAME" | head -n 1)
if [ -z "$SAVER_SRC" ]; then
echo "Error: .saver bundle not found in archive." >&2
exit 1
fi

cp -R "$SAVER_SRC" build/Fruit.saver
cp -R "$SAVER_SRC" build/"$SAVER_NAME"
rm -rf build/Fruit.xcarchive

echo "Build: build/$SAVER_NAME"

if [ "$1" = "--install" ]; then
killall legacyScreenSaver 2>/dev/null || true
rm -rf "$INSTALL_DIR/$SAVER_NAME"
cp -R build/"$SAVER_NAME" "$INSTALL_DIR/$SAVER_NAME"
xattr -dr com.apple.quarantine "$INSTALL_DIR/$SAVER_NAME" 2>/dev/null || true
echo "Installed to: $INSTALL_DIR/$SAVER_NAME"
fi
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,64 @@
# Changelog

## [1.3.4]

### Features

- Added Psychedelic and Liquid background layers with Metal shaders.
- Added Irish Ocean background — a Metal shader simulating a dark, moody North Atlantic ocean featuring:
- Rolling wave fronts moving top-to-bottom with natural wobble.
- Deep Titanic-style blue palette from near-black troughs to steel-blue crests.
- Foam and wind-blown spray on steep wave crests.
- Visible surface current swirls via chained FBM domain warping.
- Overcast specular glints and atmospheric vignette.
- Added PuppyLayer with animated Fruit logo tunnel zoom effect.
- Added Warp Speed background — the most ambitious and complex rendering in this project. A Metal shader simulating relativistic travel through a star field, featuring:
- Relativistic aberration (stars compress toward the center at speed).
- Doppler color shift (blueshift forward, redshift at the edges).
- Relativistic beaming (center brightens, periphery dims).
- Comet-like streak taper with speed-dependent particle motion.
- Dynamic tunnel vignette that narrows at warp.
- Micro vibrations during acceleration and deceleration.
- Back-easing curves with anticipation and overshoot for dramatic speed transitions.

### Bug Fixes

- Fixed screensaver install cache bug where macOS continues running the old binary after replacement. `cp -R` merges directories instead of replacing them, leaving stale binaries behind. `legacyScreenSaver.appex` and `WallpaperAgent` further cache the loaded bundle in memory and across reboots. The build script now supports `--install` to handle the full replacement sequence automatically.
- Added debug stats overlay (FPS, CPU, GPU) to FruitScreensaver and PreferencesViewController, gated behind a `showDebugStats` toggle.
- Fixed star artifact in Liquid and Psychedelic Metal shaders.
- Fixed Metal layer resolution on resize and WarpLayer scaling.
- Fixed release workflow bugs and added missing permissions.
- Fixed 13 bugs found during code review:
- Fixed layer leak in `FruitView.setupLayersOrUpdate()` where stale `BackgroundLayer`s accumulated on every mode change.
- Fixed strong `self` capture in `randomlyChangeFruitType()` animation closure that kept torn-down views alive.
- Fixed display link dangling pointer by introducing a `DisplayLinkContext` wrapper with a weak reference.
- Restored Metal `init(layer:)` implementations so presentation layers render correctly.
- Added missing `update(deltaTime:)` to `BackgroundLayer`.
- Replaced double force-unwrap in `PreferencesRepositoryImpl` with `guard let` and a descriptive `fatalError`.
- Made `preferencesRepository` non-optional in `PreferencesViewController`.
- Fixed `MetalSolidLayer` discarding excess elapsed time on color transitions.
- Recreate display link when window moves to a different screen.
- Replaced force-unwraps in `setupLayersOrUpdate()` with `guard let`.
- Replaced deprecated `lockFocus`/`unlockFocus` with `NSImage(size:flipped:drawingHandler:)`.
- Removed `fatalError` default implementations from `Background` protocol extension in favor of compile-time enforcement.
- Replaced `NSApplicationMain` with `app.run()` in `FruitShop/main.swift`.
- Fixed all SwiftLint warnings.
- Added Xcode build verification to CI workflow.

## [1.3.3]

### Bug Fixes

- Fixed macOS Sonoma screensaver lifecycle bugs:
- Detect real `isPreview` state from frame size (FB7486243).
- Replace immediate `terminate` with delayed `exit(0)` to avoid black-screen race.
- Add lame-duck pattern to handle zombie multi-instance stacking (FB19204084).
- Refresh preferences on each `startAnimation` via `synchronize()`.
- Override `startAnimation`/`stopAnimation` for proper lifecycle management.
- Replace `fatalError` in Metal setup with graceful nil-guarded fallback.
- Fixed mask and background layer `contentsScale` for external monitors. The fruit/leaf `CAShapeLayer` masks and `BackgroundLayer` defaulted to 1.0 regardless of display, causing jagged logo edges on HiDPI screens.
- Fixed copyright notice to reflect MIT license.

## [1.3.2]

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion Docs/Bug-Report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Code review of the Fruit screensaver codebase. Findings are grouped by severity.

## Critical

### 1. Layer leak in `FruitView.setupLayersOrUpdate()` -- FIXED
### 1. Layer leak in `FruitView.setupLayersOrUpdate()`

**File:** `FruitFarm/FruitView.swift`

Expand Down
Loading
Loading