mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-28 11:57:24 +08:00
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:
@@ -294,13 +294,16 @@ UIWindowScene *UIKit_GetActiveWindowScene(void)
|
|||||||
void UIKit_SetGameControllerInteraction(bool enabled)
|
void UIKit_SetGameControllerInteraction(bool enabled)
|
||||||
{
|
{
|
||||||
if (@available(iOS 13.0, tvOS 13.0, *)) {
|
if (@available(iOS 13.0, tvOS 13.0, *)) {
|
||||||
UIWindowScene *scene = UIKit_GetActiveWindowScene();
|
NSSet<UIScene *> *connectedScenes = [UIApplication sharedApplication].connectedScenes;
|
||||||
if (scene == nil) {
|
for (UIScene *scene in connectedScenes) {
|
||||||
return;
|
if (![scene isKindOfClass:[UIWindowScene class]]) {
|
||||||
}
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for (UIWindow *window in scene.windows) {
|
UIWindowScene *windowScene = (UIWindowScene *)scene;
|
||||||
UIKit_SetViewGameControllerInteraction(window, enabled);
|
for (UIWindow *window in windowScene.windows) {
|
||||||
|
UIKit_SetViewGameControllerInteraction(window, enabled);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user