win32: Set all size and position variables for external windows

This commit is contained in:
Frank Praznik 2023-12-15 15:54:01 -05:00
parent 8c285828e5
commit b937c54b66

View File

@ -361,8 +361,8 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, HWND hwnd
int h = rect.bottom;
if (window->flags & SDL_WINDOW_EXTERNAL) {
window->windowed.w = window->w = w;
window->windowed.h = window->h = h;
window->floating.w = window->windowed.w = window->w = w;
window->floating.h = window->windowed.h = window->h = h;
} else if ((window->windowed.w && window->windowed.w != w) || (window->windowed.h && window->windowed.h != h)) {
/* We tried to create a window larger than the desktop and Windows didn't allow it. Override! */
int x, y;
@ -384,8 +384,8 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, HWND hwnd
point.y = 0;
if (ClientToScreen(hwnd, &point)) {
if (window->flags & SDL_WINDOW_EXTERNAL) {
window->windowed.x = point.x;
window->windowed.y = point.y;
window->floating.x = window->windowed.x = point.x;
window->floating.y = window->windowed.y = point.y;
}
window->x = point.x;
window->y = point.y;