Skip to content

Commit 58f4d04

Browse files
committed
tvOS: continue to use draw observer
1 parent f01a03c commit 58f4d04

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

ui/drivers/cocoa/cocoa_common.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,11 @@ static void rarch_draw_observer(CFRunLoopObserverRef observer,
120120
#endif
121121

122122
runloop_flags = runloop_get_flags();
123+
#if !TARGET_OS_TV
123124
if (runloop_flags & RUNLOOP_FLAG_FASTMOTION)
125+
#endif
124126
CFRunLoopWakeUp(CFRunLoopGetMain());
125-
#if TARGET_OS_IPHONE
127+
#if TARGET_OS_IOS
126128
else
127129
rarch_stop_draw_observer();
128130
#endif
@@ -133,6 +135,7 @@ void rarch_start_draw_observer(void)
133135
if (iterate_observer && CFRunLoopObserverIsValid(iterate_observer))
134136
return;
135137

138+
RARCH_LOG("[NS] starting draw observer\n");
136139
if (iterate_observer != NULL)
137140
CFRelease(iterate_observer);
138141
iterate_observer = CFRunLoopObserverCreate(0, kCFRunLoopBeforeWaiting,
@@ -144,6 +147,7 @@ void rarch_stop_draw_observer(void)
144147
{
145148
if (!iterate_observer || !CFRunLoopObserverIsValid(iterate_observer))
146149
return;
150+
RARCH_LOG("[NS] stopping draw observer\n");
147151
CFRunLoopObserverInvalidate(iterate_observer);
148152
CFRelease(iterate_observer);
149153
iterate_observer = NULL;
@@ -176,6 +180,7 @@ -(void)step:(CADisplayLink*)target API_AVAILABLE(macos(14.0), ios(3.1), tvos(3.1
176180
return;
177181
}
178182

183+
#if !TARGET_OS_TV
179184
uint32_t runloop_flags = runloop_get_flags();
180185
if (runloop_flags & RUNLOOP_FLAG_FASTMOTION)
181186
{
@@ -184,6 +189,7 @@ -(void)step:(CADisplayLink*)target API_AVAILABLE(macos(14.0), ios(3.1), tvos(3.1
184189
CFRunLoopWakeUp(CFRunLoopGetMain());
185190
}
186191
#endif
192+
#endif
187193
}
188194
#endif
189195

ui/drivers/ui_cocoatouch.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,10 @@ - (void)applicationDidBecomeActive:(UIApplication *)application
970970
if (!ui_companion_start_on_boot)
971971
[self showGameView];
972972

973+
#if TARGET_OS_TV
974+
rarch_start_draw_observer();
975+
#endif
976+
973977
#ifdef HAVE_CLOUDSYNC
974978
if (self.bgDate)
975979
{

0 commit comments

Comments
 (0)