tvOS has its own beautiful screensavers and I would like them

This commit is contained in:
Eric Warmenhoven 2023-05-10 12:57:02 -04:00 committed by LibretroAdmin
parent 9f5a73ef07
commit 22dc543364
3 changed files with 19 additions and 5 deletions

View File

@ -86,7 +86,10 @@ static void cocoa_vk_gfx_ctx_destroy(void *data)
static enum gfx_ctx_api cocoa_vk_gfx_ctx_get_api(void *data) { return GFX_CTX_VULKAN_API; }
static bool cocoa_vk_gfx_ctx_suppress_screensaver(void *data, bool enable) { return false; }
static bool cocoa_vk_gfx_ctx_suppress_screensaver(void *data, bool disable)
{
return [apple_platform setDisableDisplaySleep:disable];
}
static void cocoa_vk_gfx_ctx_input_driver(void *data,
const char *name,

View File

@ -11571,7 +11571,7 @@ static bool setting_append_list(
START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group);
#if !defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)
#if (!defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)) || (defined(IOS) && TARGET_OS_TV)
CONFIG_BOOL(
list, list_info,
&settings->bools.ui_suspend_screensaver_enable,

View File

@ -336,7 +336,10 @@ enum
#pragma mark - ApplePlatform
-(id)renderView { return _renderView; }
-(bool)hasFocus { return YES; }
-(bool)hasFocus
{
return [[UIApplication sharedApplication] applicationState] == UIApplicationStateActive;
}
- (void)setViewType:(apple_view_type_t)vt
{
@ -400,7 +403,15 @@ enum
}
- (void)setCursorVisible:(bool)v { /* no-op for iOS */ }
- (bool)setDisableDisplaySleep:(bool)disable { /* no-op for iOS */ return NO; }
- (bool)setDisableDisplaySleep:(bool)disable
{
#if TARGET_OS_TV
[[UIApplication sharedApplication] setIdleTimerDisabled:disable];
return YES;
#else
return NO;
#endif
}
+ (RetroArch_iOS*)get { return (RetroArch_iOS*)[[UIApplication sharedApplication] delegate]; }
-(NSString*)documentsDirectory
@ -500,9 +511,9 @@ enum
#if TARGET_OS_IOS
[self setToolbarHidden:true animated:NO];
[[UIApplication sharedApplication] setStatusBarHidden:true withAnimation:UIStatusBarAnimationNone];
[[UIApplication sharedApplication] setIdleTimerDisabled:true];
#endif
[[UIApplication sharedApplication] setIdleTimerDisabled:true];
[self.window setRootViewController:[CocoaView get]];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{