mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-01-18 02:47:06 +00:00
Added SDL_PROP_WINDOW_CREATE_WINDOWSCENE_POINTER
This lets applications choose which scene their windows are being created in. For example one window might be video output in a scene with a session role of UIWindowSceneSessionRoleExternalDisplayNonInteractive, and video controls in a scene with a session role of UIWindowSceneSessionRoleApplication.
This commit is contained in:
@@ -173,7 +173,10 @@ bool UIKit_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti
|
||||
|
||||
UIWindow *uiwindow = nil;
|
||||
if (@available(iOS 13.0, tvOS 13.0, *)) {
|
||||
UIWindowScene *scene = UIKit_GetActiveWindowScene();
|
||||
UIWindowScene *scene = (__bridge UIWindowScene *)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_WINDOWSCENE_POINTER, NULL);
|
||||
if (!scene) {
|
||||
scene = UIKit_GetActiveWindowScene();
|
||||
}
|
||||
if (scene) {
|
||||
uiwindow = [[UIWindow alloc] initWithWindowScene:scene];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user