X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=ApplicationController.m;h=2edac94393594e30464bfa5a59c5b3d98dc36a64;hp=4a4deeaeede3cde0d189299c9bd6f5f29aedda0c;hb=5a79f9f05829ca1aecc70aeadb8c980ec4f3556d;hpb=51ca12b552a9c17c4d4029b0340e193b273044a8 diff --git a/ApplicationController.m b/ApplicationController.m index 4a4deea..2edac94 100644 --- a/ApplicationController.m +++ b/ApplicationController.m @@ -24,7 +24,7 @@ pascal OSStatus appSwitch(EventHandlerCallRef handlerChain, EventRef event, void et.eventClass = kEventClassApplication; et.eventKind = kEventAppFrontSwitched; EventHandlerUPP handler = NewEventHandlerUPP(appSwitch); - InstallApplicationEventHandler(handler, 1, &et, self, NULL); + InstallApplicationEventHandler(handler, 1, &et, (void *)CFBridgingRetain(self), NULL); } -(void) applicationWillTerminate: (NSNotification *)aNotification { @@ -39,7 +39,7 @@ pascal OSStatus appSwitch(EventHandlerCallRef handlerChain, EventRef event, void } pascal OSStatus appSwitch(EventHandlerCallRef handlerChain, EventRef event, void* userData) { - ApplicationController* self = (ApplicationController*)userData; + ApplicationController* self = (__bridge ApplicationController*)userData; NSDictionary* currentApp = [[NSWorkspace sharedWorkspace] activeApplication]; ProcessSerialNumber psn; psn.lowLongOfPSN = [currentApp[@"NSApplicationProcessSerialNumberLow"] longValue];