Skip to content

Commit

Permalink
Mac screensaver: If no application screensaver is running, don't disp…
Browse files Browse the repository at this point in the history
…lay "screensaver is not compatible with this version of OS X."
  • Loading branch information
Charlie Fenton committed Oct 4, 2018
1 parent bc3853d commit 78dc381
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clientscr/Mac_Saver_ModuleView.m
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,12 @@ - (void)stopAnimation {
[ super stopAnimation ];

if ([ self isPreview ]) return;
#if ! DEBUG_UNDER_XCODE
NSRect windowFrame = [ [ self window ] frame ];
if ( (windowFrame.origin.x != 0) || (windowFrame.origin.y != 0) ) {
return; // We draw only to main screen
}
#endif
if (imageView) {
useCGWindowList = false;
// removeFromSuperview must be called from main thread
Expand Down Expand Up @@ -548,7 +550,9 @@ - (void)doPeriodicTasks {
// and IOSurfaceBuffer support, so try to use CGWindowListCreateImage
// method. If that fails MAX_CGWINDOWLIST_TRIES times then assume
// the graphics app is not compatible with OS 10.13+ and kill it.
if (gfxAppStartTime) {
//
// taskSlot<0 if no worker app is running, so launching default graphics
if (gfxAppStartTime && (taskSlot >= 0)) {
if ((getDTime() - gfxAppStartTime)> MAXWAITFORCONNECTION) {
if (++CGWindowListTries > MAX_CGWINDOWLIST_TRIES) {
// After displaying message for 5 seconds, incompatibleGfxApp
Expand Down Expand Up @@ -770,12 +774,14 @@ - (void)doPeriodicTasks {


- (void)animateOneFrame {
#if ! DEBUG_UNDER_XCODE
if ( ! [ self isPreview ] ) {
NSRect windowFrame = [ [ self window ] frame ];
if ( (windowFrame.origin.x != 0) || (windowFrame.origin.y != 0) ) {
return; // We draw only to main screen
}
}
#endif
// Drawing in animateOneFrame doesn't seem to work under OS 10.14 Mojave
// but drawing in drawRect: seems slow under erarlier versions of OS X
if (mojave) {
Expand Down

0 comments on commit 78dc381

Please sign in to comment.