Set window controller interaction on all windows

We should update all windows, not just the ones in the active scene
This commit is contained in:
Sam Lantinga
2025-11-26 11:50:54 -08:00
parent eda8d1d842
commit 54b15532d3

View File

@@ -294,13 +294,16 @@ UIWindowScene *UIKit_GetActiveWindowScene(void)
void UIKit_SetGameControllerInteraction(bool enabled)
{
if (@available(iOS 13.0, tvOS 13.0, *)) {
UIWindowScene *scene = UIKit_GetActiveWindowScene();
if (scene == nil) {
return;
}
NSSet<UIScene *> *connectedScenes = [UIApplication sharedApplication].connectedScenes;
for (UIScene *scene in connectedScenes) {
if (![scene isKindOfClass:[UIWindowScene class]]) {
continue;
}
for (UIWindow *window in scene.windows) {
UIKit_SetViewGameControllerInteraction(window, enabled);
UIWindowScene *windowScene = (UIWindowScene *)scene;
for (UIWindow *window in windowScene.windows) {
UIKit_SetViewGameControllerInteraction(window, enabled);
}
}
}
}