Fixed restoring window size when coming out of fullscreen desktop mode.
authorSam Lantinga <slouken@libsdl.org>
Fri, 06 Oct 2017 21:43:59 -0700
changeset 115754006cd3d0a73
parent 11574 696d0036f442
child 11577 a68ad1ddb897
Fixed restoring window size when coming out of fullscreen desktop mode.
Use the style of the window as it will be, not as it currently is at the
time of the AdjustWindowRect call.
src/video/windows/SDL_windowswindow.c
     1.1 --- a/src/video/windows/SDL_windowswindow.c	Fri Oct 06 16:50:24 2017 -0700
     1.2 +++ b/src/video/windows/SDL_windowswindow.c	Fri Oct 06 21:43:59 2017 -0700
     1.3 @@ -595,6 +595,8 @@
     1.4              style &= ~WS_MAXIMIZE;
     1.5          }
     1.6      } else {
     1.7 +        BOOL menu;
     1.8 +
     1.9          /* Restore window-maximization state, as applicable.
    1.10             Special care is taken to *not* do this if and when we're
    1.11             alt-tab'ing away (to some other window; as indicated by
    1.12 @@ -606,7 +608,8 @@
    1.13              data->windowed_mode_was_maximized = SDL_FALSE;
    1.14          }
    1.15  
    1.16 -        WIN_AdjustWindowRect(window, &x, &y, &w, &h, SDL_FALSE);
    1.17 +        menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
    1.18 +        WIN_AdjustWindowRectWithStyle(window, style, menu, &x, &y, &w, &h, SDL_FALSE);
    1.19      }
    1.20      SetWindowLong(hwnd, GWL_STYLE, style);
    1.21      data->expected_resize = SDL_TRUE;