Wednesday, December 10, 2025

How to Make a macOS Screen Saver

Wade Tregaskis:

Given how buggy Apple’s screen saver framework is, I suggest not relying on animateOneFrame if you can at all avoid it. Even if that means setting up your own timer. That way when they likely break that too in some future macOS release, your screen saver won’t necessarily break as well.

[…]

stopAnimation is only used for the live preview thumbnail shown in the Screen Saver System Settings pane. It is never called in normal operation of the screen saver (contrary to what Apple’s documentation says – Apple broke that in macOS Sonoma and later).

[…]

Here’s the second big bug in Apple’s screen saver framework – every time the screen saver starts, your ScreenSaverView subclass is created again. But the old one doesn’t go anywhere. So now you have two copies running simultaneously, which as at the very least wasteful, and can easily lead to gnarly bugs and weird behaviour (e.g. if both are playing sound, or both modify persistent state).

[…]

Unfortunately Apple’s screen saver system will never terminate your screen saver process. Worse, even if you do nothing yourself, Apple’s screen saver framework code will run in an infinite loop, wasting [a small amount of] CPU time.

There was a longstanding API that worked fine for many years but then got progressively more broken.

Update (2025-12-11): James Miller:

Same experience years ago making a recreation of the After Dark Flying Toaster screensaver. It was such a strange development process…

Kevin Boyd:

I tried writing one a few years ago and got stymied by everything being terrible & no information being available. Maybe I can get back into it soon.

8 Comments RSS · Twitter · Mastodon


I put the Display to Sleep instead of using Screen Savers (better for power saving), but reading this made me so angry.

It won't get fixed. Fixing it doesn't move the stock price. We're more likely to get Swift ScreenSaver from a ladder-climber inside Apple who'll make a big WWDC appearance about Safe Screensavers then ladder hop to Meta.

macOS today is buggier than macOS 9 was without protected memory.


Not only did they kill the API, but they also completely ruined the settings in System Preferences.

Another Alan Dye and Craig Federighi's "success".


I always find it problematic that on a 2019 Mac Pro, activating the screensaver causes about a 10-20watt jump in power draw at the wall, with Flurry being the lowest use.

I'd put the displays to sleep, but that causes them to detach from the system as per the Displayport spec, and then all the windows of my garbage-tier applications (Affinity) get messed up, because they don't know how to handle display interruptions and recoveries.


My solution for screen savers is to have an SE/30 sitting on my desk with After Dark installed. It's delightful.


"macOS today is buggier than macOS 9 was without protected memory."

I had this same thought recently. Since updating to Tahoe, my cursor randomly freezes for seconds. When my Mac is doing something in the background, it eats keyboard input; I type "Hello world," and I just get "Howr". The "I copied this, and nothing got copied" problem got even worse than it was before, too.

You can say all you want about pre-X Macs, but if you moved the mouse, the cursor moved, and when you typed on your keyboard, you got the text you typed, and when you hit Cmd-C, it copied the selected thing.

"My solution for screen savers is to have an SE/30 sitting on my desk with After Dark installed"

I spent hours screen-recording the toasters on an emulated black-and-white Mac, and I just run the video as my screensaver.


> Delete the Objective-C code & header files it creates by default (unless, I suppose, you want to write your screen saver in Objective-C – woo, retro! 😆).

What are these preposterous words?


Even though it often led to a glut of system crashes, one of the amazing things about classic Mac OS and its lack of protected memory was being able to change practically any part of the system you wanted. It really made it feel like the computer was yours. I miss that a ton in modern macOS. Even if Apple fixed all of the UI design flaws and bugs, it'd still be a system that doesn't let you customize it in a really fundamental way.


Yep. Apple managed to totally break the new “legacyScreenSaver” engine in Sonoma, again in Sequoia, and again in Tahoe. It’s amazing, because one would assume the “legacy” engine would implement the API as written. Nope!

Through several rounds of group effort, we managed to un-tangle the mess and come up with a ton of workarounds.

One particular fix we came up with is that it’s better to call exit(0) instead of NSApplication.shared.terminate.

Please read the thread here: https://github.com/JohnCoates/Aerial/issues/1396 for the gory details. There are links in that thread to Apple Developer forum posts which are also interesting – at least one Apple employee knows the situation is a mess.

Leave a Comment