Hey Guys
So the runloop code had some issues on Yosemite. Namely it would beachball until the first event could finally be sent. God knows why, but [NSAppnextEventMatchingMask:NSAnyEventMaskuntilDate:[NSDatedistantPast] inMode:NSDefaultRunLoopModedequeue:YES]; would forever return nil and never deliver any events.
I got around this by adding the following just before the for loop in Cocoa_PumpEvents
My guess is [NSApp sendEvent] MUST get called at least once so OSX knows the app is alive.
//better let cocoa know that we're at least here somehow
static BOOL atLeastOnce = FALSE;
if(!atLeastOnce)
{
NSTimeIntervalti = [[NSProcessInfoprocessInfo] systemUptime];
NSEvent*someEvent = [NSEventmouseEventWithType:NSMouseMovedlocation:NSMakePoint(100, 100) modifierFlags:0timestamp:ti windowNumber:0context:nileventNumber:0clickCount:0pressure:0];
[NSApp postEvent:someEvent atStart:YES];
atLeastOnce = TRUE;
}
pool = [[NSAutoreleasePoolalloc] init];
for ( ; ; ) {
/…/
}
Feel free to use this solution when working on SDL in the future
regards,
~mike