From d1c35febce490c4784b50356f1b394e8ac389607 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 25 Nov 2016 00:13:13 -0500 Subject: [PATCH] macOS: removed deprecated UpdateSystemActivity() call. The non-deprecated approach (IOPMAssertion) already exists in SDL, and is available in Mac OS X 10.6 and later (although it was incorrectly listed as 10.7 and later in SDL). Since SDL now requires 10.6 or later, this is no longer conditionally used. --- src/video/cocoa/SDL_cocoaevents.m | 15 --------------- src/video/cocoa/SDL_cocoavideo.h | 1 - src/video/cocoa/SDL_cocoavideo.m | 3 --- 3 files changed, 19 deletions(-) diff --git a/src/video/cocoa/SDL_cocoaevents.m b/src/video/cocoa/SDL_cocoaevents.m index 17a3183b7795d..5772685bd14c0 100644 --- a/src/video/cocoa/SDL_cocoaevents.m +++ b/src/video/cocoa/SDL_cocoaevents.m @@ -394,17 +394,6 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam Cocoa_PumpEvents(_THIS) { @autoreleasepool { - /* Update activity every 30 seconds to prevent screensaver */ - SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; - if (_this->suspend_screensaver && !data->screensaver_use_iopm) { - Uint32 now = SDL_GetTicks(); - if (!data->screensaver_activity || - SDL_TICKS_PASSED(now, data->screensaver_activity + 30000)) { - UpdateSystemActivity(UsrActivity); - data->screensaver_activity = now; - } - } - for ( ; ; ) { NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ]; if ( event == nil ) { @@ -426,10 +415,6 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam { SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; - if (!data->screensaver_use_iopm) { - return; - } - if (data->screensaver_assertion) { IOPMAssertionRelease(data->screensaver_assertion); data->screensaver_assertion = 0; diff --git a/src/video/cocoa/SDL_cocoavideo.h b/src/video/cocoa/SDL_cocoavideo.h index 498ce6ccaa9a5..90c46a79591f8 100644 --- a/src/video/cocoa/SDL_cocoavideo.h +++ b/src/video/cocoa/SDL_cocoavideo.h @@ -52,7 +52,6 @@ typedef struct SDL_VideoData SDLTranslatorResponder *fieldEdit; NSInteger clipboard_count; Uint32 screensaver_activity; - BOOL screensaver_use_iopm; IOPMAssertionID screensaver_assertion; } SDL_VideoData; diff --git a/src/video/cocoa/SDL_cocoavideo.m b/src/video/cocoa/SDL_cocoavideo.m index e436e652107f6..1e1f70f02278f 100644 --- a/src/video/cocoa/SDL_cocoavideo.m +++ b/src/video/cocoa/SDL_cocoavideo.m @@ -152,9 +152,6 @@ data->allow_spaces = ((floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) && SDL_GetHintBoolean(SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES, SDL_TRUE)); - /* The IOPM assertion API can disable the screensaver as of 10.7. */ - data->screensaver_use_iopm = floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6; - return 0; }