Skip to content

Commit

Permalink
Allow more than one window on iOS as long as they're on different dis…
Browse files Browse the repository at this point in the history
…plays
  • Loading branch information
slouken committed Oct 15, 2020
1 parent a90f040 commit 58976bd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/video/uikit/SDL_uikitwindow.m
Expand Up @@ -162,14 +162,14 @@ - (void)layoutSubviews
@autoreleasepool {
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata;

/* SDL currently puts this window at the start of display's linked list. We rely on this. */
SDL_assert(_this->windows == window);
SDL_Window *other;

/* We currently only handle a single window per display on iOS */
if (window->next != NULL) {
return SDL_SetError("Only one window allowed per display.");
}
for (other = _this->windows; other; other = other->next) {
if (other != window && SDL_GetDisplayForWindow(other) == display) {
return SDL_SetError("Only one window allowed per display.");
}
}

/* If monitor has a resolution of 0x0 (hasn't been explicitly set by the
* user, so it's in standby), try to force the display to a resolution
Expand Down

0 comments on commit 58976bd

Please sign in to comment.