Let Windows track floating window state

This fixes restoring window size and position after moving it to a tiled location (which isn't maximized) and then back.
main
Sam Lantinga 2024-01-12 10:03:13 -08:00
parent 98be55894e
commit f0b9c7f0f0
1 changed files with 0 additions and 15 deletions

View File

@ -1087,21 +1087,6 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_WINDOWPOSCHANGING:
{
WINDOWPOS *windowpos = (WINDOWPOS*)lParam;
if (!IsIconic(hwnd) &&
!IsZoomed(hwnd) &&
(data->window->flags & (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED)) &&
!(data->window->flags & SDL_WINDOW_FULLSCREEN)) {
/* Use the stored floating size if moving from a fixed-size to floating state. */
int fx, fy, fw, fh;
WIN_AdjustWindowRect(data->window, &fx, &fy, &fw, &fh, SDL_WINDOWRECT_FLOATING);
windowpos->x = fx;
windowpos->y = fy;
windowpos->cx = fw;
windowpos->cy = fh;
windowpos->flags &= ~(SWP_NOSIZE | SWP_NOMOVE);
}
} break;
case WM_WINDOWPOSCHANGED: