Fixed bug 3503 - osx builds don't run on 10.6 as of rev. 10651
Ozkan Sezer With rev. 10651, i.e. http://hg.libsdl.org/SDL/rev/747a6a795b21 , SDL2 - OS X builds fail to run on 10.6 (my setup: i686 / 10.6.8) because the symbol _IOPMAssertionCreateWithDescription is missing. The SDK listing it for 10.7+ does seem correct. Reverting r10651 and rebuilding makes it to function again.
parent
4905cd9c09
commit
1b689c335c
|
@ -394,6 +394,17 @@ void
|
||||||
Cocoa_PumpEvents(_THIS)
|
Cocoa_PumpEvents(_THIS)
|
||||||
{ @autoreleasepool
|
{ @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 ( ; ; ) {
|
for ( ; ; ) {
|
||||||
NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
|
NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
|
||||||
if ( event == nil ) {
|
if ( event == nil ) {
|
||||||
|
@ -415,6 +426,10 @@ Cocoa_SuspendScreenSaver(_THIS)
|
||||||
{
|
{
|
||||||
SDL_VideoData *data = (SDL_VideoData *)_this->driverdata;
|
SDL_VideoData *data = (SDL_VideoData *)_this->driverdata;
|
||||||
|
|
||||||
|
if (!data->screensaver_use_iopm) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (data->screensaver_assertion) {
|
if (data->screensaver_assertion) {
|
||||||
IOPMAssertionRelease(data->screensaver_assertion);
|
IOPMAssertionRelease(data->screensaver_assertion);
|
||||||
data->screensaver_assertion = 0;
|
data->screensaver_assertion = 0;
|
||||||
|
|
|
@ -52,6 +52,7 @@ typedef struct SDL_VideoData
|
||||||
SDLTranslatorResponder *fieldEdit;
|
SDLTranslatorResponder *fieldEdit;
|
||||||
NSInteger clipboard_count;
|
NSInteger clipboard_count;
|
||||||
Uint32 screensaver_activity;
|
Uint32 screensaver_activity;
|
||||||
|
BOOL screensaver_use_iopm;
|
||||||
IOPMAssertionID screensaver_assertion;
|
IOPMAssertionID screensaver_assertion;
|
||||||
|
|
||||||
} SDL_VideoData;
|
} SDL_VideoData;
|
||||||
|
|
|
@ -152,6 +152,9 @@ Cocoa_VideoInit(_THIS)
|
||||||
|
|
||||||
data->allow_spaces = ((floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) && SDL_GetHintBoolean(SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES, SDL_TRUE));
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue