mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 00:32:49 +00:00
(OSX PowerPC) PowerPC Fixed
This commit is contained in:
parent
ad15f76ff5
commit
8c3479f850
@ -80,7 +80,7 @@ static enum ui_msg_window_response ui_msg_window_cocoa_dialog(ui_msg_window_stat
|
||||
break;
|
||||
}
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
|
||||
[alert beginSheetModalForWindow:(BRIDGE NSWindow *)ui_companion_driver_get_main_window()
|
||||
completionHandler:^(NSModalResponse returnCode) {
|
||||
[[NSApplication sharedApplication] stopModalWithCode:returnCode];
|
||||
|
@ -42,6 +42,7 @@
|
||||
#import <MetalKit/MetalKit.h>
|
||||
#endif
|
||||
|
||||
#if !((defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__))))
|
||||
@interface WindowListener : NSResponder<NSWindowDelegate>
|
||||
@end
|
||||
|
||||
@ -59,6 +60,7 @@
|
||||
{}
|
||||
|
||||
@end
|
||||
#endif
|
||||
|
||||
id<ApplePlatform> apple_platform;
|
||||
|
||||
@ -72,7 +74,9 @@ id<ApplePlatform> apple_platform;
|
||||
apple_view_type_t _vt;
|
||||
NSView* _renderView;
|
||||
id _sleepActivity;
|
||||
#if !(defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
|
||||
WindowListener *_listener;
|
||||
#endif
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) NSWindow IBOutlet* window;
|
||||
@ -261,11 +265,15 @@ static char** waiting_argv;
|
||||
[self.window setCollectionBehavior:NS_WINDOW_COLLECTION_BEHAVIOR_FULLSCREEN_PRIMARY];
|
||||
}
|
||||
|
||||
#if !(defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
|
||||
_listener = [WindowListener new];
|
||||
#endif
|
||||
|
||||
[self.window setAcceptsMouseMovedEvents: YES];
|
||||
#if !(defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
|
||||
[self.window setNextResponder:_listener];
|
||||
self.window.delegate = _listener;
|
||||
#endif
|
||||
|
||||
[[self.window contentView] setAutoresizesSubviews:YES];
|
||||
|
||||
@ -331,10 +339,12 @@ static char** waiting_argv;
|
||||
}
|
||||
|
||||
_renderView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
|
||||
_renderView.frame = self.window.contentView.bounds;
|
||||
[_renderView setFrame: [[self.window contentView] bounds]];
|
||||
|
||||
self.window.contentView = _renderView;
|
||||
#if !(defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
|
||||
[self.window.contentView setNextResponder:_listener];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (apple_view_type_t)viewType {
|
||||
@ -349,15 +359,19 @@ static char** waiting_argv;
|
||||
return [NSApp isActive];
|
||||
}
|
||||
|
||||
#define NS_FULLSCREEN_WINDOW_MASK (1 << 14)
|
||||
|
||||
- (void)setVideoMode:(gfx_ctx_mode_t)mode {
|
||||
BOOL isFullScreen = (self.window.styleMask & NSFullScreenWindowMask) == NSFullScreenWindowMask;
|
||||
if (mode.fullscreen && !isFullScreen)
|
||||
BOOL isFullScreen = (self.window.styleMask & NS_FULLSCREEN_WINDOW_MASK) == NS_FULLSCREEN_WINDOW_MASK;
|
||||
SEL fselector = NSSelectorFromString(BOXSTRING("toggleFullScreen"));
|
||||
|
||||
if (mode.fullscreen && !isFullScreen && [self.window respondsToSelector:fselector])
|
||||
{
|
||||
[self.window toggleFullScreen:self];
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mode.fullscreen && isFullScreen)
|
||||
if (!mode.fullscreen && isFullScreen && [self.window respondsToSelector:fselector])
|
||||
{
|
||||
[self.window toggleFullScreen:self];
|
||||
}
|
||||
@ -379,7 +393,7 @@ static char** waiting_argv;
|
||||
|
||||
- (bool)setDisableDisplaySleep:(bool)disable
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
|
||||
if (disable && _sleepActivity == nil)
|
||||
{
|
||||
_sleepActivity = [NSProcessInfo.processInfo beginActivityWithOptions:NSActivityIdleDisplaySleepDisabled reason:@"disable screen saver"];
|
||||
|
Loading…
x
Reference in New Issue
Block a user