mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-02 07:27:19 +08:00
Fixed getting the initial window safe area
Fixes testsprite and testwm on desktop platforms
This commit is contained in:
@@ -3860,7 +3860,12 @@ int SDL_GetWindowSafeArea(SDL_Window *window, SDL_Rect *rect)
|
|||||||
CHECK_WINDOW_MAGIC(window, -1);
|
CHECK_WINDOW_MAGIC(window, -1);
|
||||||
|
|
||||||
if (rect) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user