Fixed crash if a window ends up without a display
Some checks are pending
Build (All) / Create test plan (push) Waiting to run
Build (All) / level1 (push) Blocked by required conditions
Build (All) / level2 (push) Blocked by required conditions

This commit is contained in:
Sam Lantinga 2024-11-20 13:27:43 -08:00
parent 35e6c92c3c
commit 1413848f41

View file

@ -2413,7 +2413,7 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
if (flags & SDL_WINDOW_FULLSCREEN || IsFullscreenOnly(_this)) { if (flags & SDL_WINDOW_FULLSCREEN || IsFullscreenOnly(_this)) {
SDL_Rect bounds; SDL_Rect bounds;
SDL_GetDisplayBounds(display->id, &bounds); SDL_GetDisplayBounds(display ? display->id : SDL_GetPrimaryDisplay(), &bounds);
window->x = bounds.x; window->x = bounds.x;
window->y = bounds.y; window->y = bounds.y;
window->w = bounds.w; window->w = bounds.w;