On Apr 15, 2025, at 07:57, Gabriel Zachmann via Cocoa-dev 
<cocoa-dev@lists.apple.com> wrote:
> 
> But that does not explain, why new settings will not become persistent, does 
> it?
> I mean, when I do
>       [defaults_ setObject: monitor_user_prefs forKey: displayName_];
> the Mac *could* write the new settings into persistent memory/disk ...
> 
> Or is there a dedicated command that would force macOS to write the settings?

It's up to the OS to actually write the defaults to disk when it wants to. So 
if you write some prefs during the run of your screensaver, you have no idea 
*when* they'll actually be written to disk. And if your screensaver instances 
keep running because of the glaring bug that's in legacyScreenSaver, then the 
changed prefs might *never* be written.

Looking at my code to handle the OK and Cancel actions for the config sheet, I 
still have these calls from way back:

[defaults synchronize]; // It says this isn't needed, but it sure seems to be 
for a screensaver pref, with this comment:

I'd say try using that and see if it helps. But, exactly why and when are you 
writing prefs during the run of your screensaver instances? Or are you only 
writing them during in the config sheet? Maybe we can figure out an alternate 
solution.

> That whole business brings up the question: should we abandon 
> legacyScreenSaver?
> 
> If I understand correctly, there is a new framework, something to do with 
> wallpapers?
> I mean, the name "legacyScreenSaver" suggest, that this framework will be 
> going away anyways at some point ...
> 
> What are your thoughts?

The new screensaver/wallpaper model is for their silly idea of blending the 2 
together. I see that if you run some of their older screensavers, they too wil 
continue to run for a while after you wake them. The Hello one will continue to 
use up to about 25% cpu afterward. So basically, Apple simply has a big problem 
with telling many screensavers to stop.

They have not offered any Xcode template for a new style of screensaver. In 
face, the old one is still there, so Apple still expects new screensavers to 
use the legacy model. Let's hope they'll be smart and add one soon, but I'm not 
holding my breath. They appear to now live as an appex. I don't recall if 
that's how they distributed them in their previous life, before the wallpaper 
nonsense.

/System/Library/ExtensionKit/Extensions/Hello.appex/Contents/MacOS/Hello

--
Steve Mills
Drummer, Mac geek

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to