Clear the undefined position state when the window is placed

This allows the window to be recreated in the same location if needed, for example if recreated because of switching to OpenGL rendering.
This commit is contained in:
Sam Lantinga
2023-02-24 18:04:54 -08:00
parent 4d9d343662
commit 2897de9efc
3 changed files with 2 additions and 18 deletions

View File

@@ -63,10 +63,8 @@ int SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent,
window->flags |= SDL_WINDOW_HIDDEN;
break;
case SDL_EVENT_WINDOW_MOVED:
if (SDL_WINDOWPOS_ISUNDEFINED(data1) ||
SDL_WINDOWPOS_ISUNDEFINED(data2)) {
return 0;
}
window->undefined_x = SDL_FALSE;
window->undefined_y = SDL_FALSE;
if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
window->windowed.x = data1;
window->windowed.y = data2;