Re: Updating a screensaver from 10.6 to 10.10
Re: Updating a screensaver from 10.6 to 10.10
- Subject: Re: Updating a screensaver from 10.6 to 10.10
- From: Stephane Sudre <email@hidden>
- Date: Mon, 27 Jul 2015 11:28:40 +0200
• You may also need|have to consider moving away from Garbage
Collection. 10.10 (or 10.11?) is the last version to support it.
• You need to codesign the screen saver on 10.9.5 or later, otherwise,
it won't be GateKeeper v2 compatible and the user won't be able to
double-click it in the Finder to install it in the now hidden
~/Library/Screen Savers folder.
• You may need to consider providing Retina compatible image resources.
• If you want to provide a thumbnail preview to be displayed in the
Screen Savers Pref Pane list, you can add 2 PNGs in your .saver
bundle: thumbnail.png and email@hidden. (3)
• Depending on the age of your code source, you may also want to start
using a NSWindowController for the configuration sheet of the screen
saver module.
• When it comes to detecting the main screen, it depends on your
definition of the main screen. The mainScreen method returns the
screen containing the window with the keyboard focus, this may not be
the screen with the menu bar (1) (2). It's usually easier to identify
the screen with the menu bar as the first screen in the array returned
by screens.
I'm currently updating a few OS X ports of Windows Screen Savers. I'm
using mostly the same templates for all of them. Just in case, you're
looking for a template:
https://github.com/packagesdev?tab=repositories
(1) Of course, since the menu bar can be displayed on every screen in
recent versions of OS X, this can be even more confusing.
(2) Considering the menu bar is not displayed when the screen saver is
running (i.e. not preview mode), this is not really a definition of
the main screen either.
(3) Due to bugs and lack of commitment from Apple, the rendering of
one's thumbnail preview is not really good in recent OS versions. I'm
getting not too catastrophic result using this project:
https://github.com/packagesdev/screensaverthumbnailfactory
It currently requires to complete the windowDidLoadMethod of the
SSTFWindowController class to call showScreenSaverForBundle: with the
appropriate bundle for your screen saver.
On Sun, Jul 26, 2015 at 11:11 PM, Gabriel Zachmann <email@hidden> wrote:
> Dear all,
>
> I have written a screensaver , but unfortunately, I didn't have the time to update the source code sine OS X 10.7 .
> It is still working so-so, but showing signs of code aging.
>
> Now I would like to bring the source code up to date.
>
> Does anybody know of some guidelines , or a list of hints, or any other document anywhere, that would outline the exact changes
> I need to do.
> In particular, I'd like to learn more about the changes needed in CoreAnimation, in Scripting Bridge to retrieve photos from iPhoto-now-Photos,
> and the way I identify the current display/monitor.
> Below are a few code snippets, for your information.
>
> And I am interesting in anything else you might deem worthy of upgrading in the source code.
>
> Thanks a lot in advance.
>
> Best regards,
> Gabriel.
>
>
>
> -------------
> Code snippet I used to make a layer (containing only one image) cross-dissolve with a new one:
>
> [CATransaction begin];
> if ( crossDissolve_ )
> [CATransaction setAnimationDuration: fading_duration];
> else
> [CATransaction setValue: (id)kCFBooleanTrue forKey: kCATransactionDisableActions];
> [mainLayer_ replaceSublayer: currentLayer_ with: newlayer];
> currentLayer_ = newlayer;
> [CATransaction commit];
>
> ------------------
> Code snippet I used to identify monitors/displays (this seems to fail since OS X 10.9 ):
>
> displayNumber_ = [ [[newWindow screen] deviceDescription] objectForKey: @"NSScreenNumber"];
> displayID_ = [displayNumber_ unsignedIntValue];
> unsigned int main_screen_id = [[ [[NSScreen mainScreen] deviceDescription] objectForKey: @"NSScreenNumber"] unsignedIntValue];
>
> I suspect , this code does not work any more as intended, because I get often a new display ID for exactly the same monitor (just a cinema display).
>
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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:
>
> This email sent to email@hidden
--
Packaging Resources - http://s.sudre.free.fr/Packaging.html
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden