diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 34d8bfc0bf..ec30ccd531 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -42,6 +42,7 @@ #import #endif +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 @interface WindowListener : NSResponder @end @@ -59,6 +60,7 @@ {} @end +#endif id apple_platform; @@ -72,7 +74,9 @@ id apple_platform; apple_view_type_t _vt; NSView* _renderView; id _sleepActivity; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 WindowListener *_listener; +#endif } @property (nonatomic, retain) NSWindow IBOutlet* window; @@ -264,11 +268,15 @@ static char** waiting_argv; } #endif +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 _listener = [WindowListener new]; +#endif [self.window setAcceptsMouseMovedEvents: YES]; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 [self.window setNextResponder:_listener]; self.window.delegate = _listener; +#endif [[self.window contentView] setAutoresizesSubviews:YES]; @@ -286,8 +294,10 @@ static char** waiting_argv; waiting_argc = 0; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 [self.window makeMainWindow]; [self.window makeKeyWindow]; +#endif [self performSelectorOnMainThread:@selector(rarch_main) withObject:nil waitUntilDone:NO]; } @@ -305,7 +315,9 @@ static char** waiting_argv; _renderView.wantsLayer = NO; _renderView.layer = nil; [_renderView removeFromSuperview]; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 self.window.contentView = nil; +#endif _renderView = nil; } @@ -336,8 +348,13 @@ static char** waiting_argv; _renderView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; _renderView.frame = self.window.contentView.bounds; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 self.window.contentView = _renderView; [self.window.contentView setNextResponder:_listener]; +#else + [self.window.contentView addSubview:_renderView]; + [self.window makeFirstResponder:_renderView]; +#endif } - (apple_view_type_t)viewType {