diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index a940cb8c7c..1540e92b83 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -2925,11 +2925,12 @@ bool SDL_GetWindowPosition(SDL_Window *window, int *x, int *y) } } } else { + const bool use_current = !(window->flags & SDL_WINDOW_HIDDEN) && !window->last_position_pending; if (x) { - *x = window->x; + *x = use_current ? window->x : window->pending.x; } if (y) { - *y = window->y; + *y = use_current ? window->y : window->pending.y; } } return true;