X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=OSX%2FSaverRunner.m;h=20ddd650fb25ab44473dfd79d0b76e74cb26f8cd;hp=ac010b9fa760d1bbb6e0c6ccea8b6ff96086307e;hb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c;hpb=aa75c7476aeaa84cf3abc192b376a8b03c325213 diff --git a/OSX/SaverRunner.m b/OSX/SaverRunner.m index ac010b9f..20ddd650 100644 --- a/OSX/SaverRunner.m +++ b/OSX/SaverRunner.m @@ -386,7 +386,10 @@ - (BOOL)shouldAutorotate /* Added in iOS 6 */ { - return YES; + return + NSFoundationVersionNumber < NSFoundationVersionNumber_iOS_8_0 ? + ![_saverView suppressRotationAnimation] : + YES; } @@ -1453,6 +1456,7 @@ FAIL: // or two windows for SaverTester.app. for (i = 0; i < window_count; i++) { NSWindow *win = [self makeWindow]; + [win setDelegate:self]; // Get the last-saved window position out of preferences. [win setFrameAutosaveName: [NSString stringWithFormat:@"XScreenSaverWindow%d", i]]; @@ -1460,6 +1464,7 @@ FAIL: [a addObject: win]; // This prevents clicks from being seen by savers. // [win setMovableByWindowBackground:YES]; + win.releasedWhenClosed = NO; [win release]; } # else // USE_IPHONE @@ -1596,6 +1601,18 @@ FAIL: return YES; } +/* When the window is about to close, stop its animation. + Without this, timers might fire after the window is dead. + */ +- (void)windowWillClose:(NSNotification *)notification +{ + NSWindow *win = [notification object]; + NSView *cv = win ? [win contentView] : 0; + ScreenSaverView *sv = cv ? find_saverView (cv) : 0; + if (sv && [sv isAnimating]) + [sv stopAnimation]; +} + # else // USE_IPHONE - (void)applicationWillResignActive:(UIApplication *)app