Fixed getting the initial window safe area

Fixes testsprite and testwm on desktop platforms
This commit is contained in:
Sam Lantinga 2024-07-27 08:40:31 -07:00
parent 12eb1f1497
commit 625bc2d250
1 changed files with 6 additions and 1 deletions

View File

@ -3860,7 +3860,12 @@ int SDL_GetWindowSafeArea(SDL_Window *window, SDL_Rect *rect)
CHECK_WINDOW_MAGIC(window, -1);
if (rect) {
SDL_copyp(rect, &window->safe_rect);
if (SDL_RectEmpty(&window->safe_rect)) {
rect->w = window->w;
rect->h = window->h;
} else {
SDL_copyp(rect, &window->safe_rect);
}
}
return 0;
}