Screen saver settings don't take effect (again) under Sonoma
site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=uni-bremen.de; s=2019; t=1697104456; i=@uni-bremen.de; bh=rpnZhNSRbKj2whvFnPwOnEbBYb7dkR99IlADyO3Viy4=; h=From:Date:To; b=Iq24o7YaswQBc6pjGMnvH5+TMgwzo3+jOEbYAjNiU04R+aGKQhVWWCEq6fOGSKe5x 7XWV76TDS9OiK/YK+nPb4ZkRZu8S5rkBJCS/kAV+8/jO2mSIokw/AIS+T71RTQkOMA SoKpQ46GqcTtxZv2H1b3zamF2vM9zF7NoZlZfQc5qEY5thf9mHtCh0ILg2ohAODv4r RH5CAtSDcv+oXB8F0aHwRu0OzEy6SYrstjmDDwJXXrj/a7HuthB6H75/faSn3StALH EEdPLWhj6oAxUr2VZLB/7Iw8Bn3tTGgh5cpNZ8ua/qJlz6jWbv2MTOC2ZO8eDMvD86 3M6wJH1TCTNsA== IIRC, I had an issue with screen saver settings not taking effect some months ago (under Ventura), but back then it turned out to be a non-issue. Now, under Sonoma (14.0), I have an issue with the settings (user defaults) of my screen saver, again. I go into System Settings, change some settings of my screen saver, they take effect immediately in the little Preview window in SysSettings, but when I click on "Preview" or let the screen saver come on automatically, the new settings are *not* in effect.
From one user, I heard that the new settings take effect only after rebooting.
So, maybe, something has changed in the way macOS 14.0 handles the NSUserDefaults, and/or maybe I make an error with using the API. Maybe there is a bug in macOS 14.0 ? Below you can find a recap of how I handle the settings using NSUserDefaults. Interestingly, the same code works fine in a regular app (not screensaver). I will be very grateful for any kind of suggestions or insights. Best regards, Gabriel My screensaver stores different settings for different monitors in the [NSUserDefaults standardUserDefaults]. To do so, I generate defaults_ = [NSUserDefaults standardUserDefaults]; Then, I create a dictionary containing the default settings and register them, like this: NSDictionary * monitor_defaults = [NSDictionary dictionaryWithObjectsAndKeys: defaultsForMonitor, displayname, nil ]; [defaults_ registerDefaults: monitor_defaults]; NSDictionary * monitor_user_prefs = [defaults_ dictionaryForKey: displayname]; Then, I read the actual values from monitor_user_prefs. When the user changes a setting, I do the inverse, like this: .. create a new dictionary monitor_user_prefs, containing all the key/value pairs of the settings .. [defaults_ setObject: monitor_user_prefs forKey: displayName_]; bool success = [defaults_ synchronize]; _______________________________________________ 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/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com smime.p7s
participants (1)
-
Gabriel Zachmann via Cocoa-dev