Search code examples
cocoascreensaver

In my Cocoa screensaver code, how do I terminate?


In a standalone app, I would do [NSApp terminate:self] but for a screensaver bundle, this actually terminates the SystemPreferences app, which is bad.

So, in my Cocoa screensaver code, how do I terminate the screensaver?


Solution

  • According to this thread, one can propagate a mouse event which will exit the screensaver. From inside the screen saver view, one simply has to call:

    [super mouseEntered:nil];