Skip to content

Commit

Permalink
Don't attempt WM_NCCALCSIZE adjustment when in fullscreen window tran…
Browse files Browse the repository at this point in the history
…sition
  • Loading branch information
slouken committed Feb 14, 2018
1 parent ba0ecc6 commit 5abd7d1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/video/windows/SDL_windowsevents.c
Expand Up @@ -967,12 +967,14 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)

case WM_NCCALCSIZE:
{
if (wParam == TRUE && SDL_GetWindowFlags(data->window) & SDL_WINDOW_BORDERLESS) {
Uint32 window_flags = SDL_GetWindowFlags(data->window);
if (wParam == TRUE && (window_flags & SDL_WINDOW_BORDERLESS) && !(window_flags & SDL_WINDOW_FULLSCREEN)) {
/* When borderless, need to tell windows that the size of the non-client area is 0 */
if (!(SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE)) {
if (!(window_flags & SDL_WINDOW_RESIZABLE)) {
int w, h;
NCCALCSIZE_PARAMS *params = (NCCALCSIZE_PARAMS *)lParam;
SDL_GetWindowSize(data->window, &w, &h);
w = data->window->windowed.w;
h = data->window->windowed.h;
params->rgrc[0].right = params->rgrc[0].left + w;
params->rgrc[0].bottom = params->rgrc[0].top + h;
}
Expand Down

0 comments on commit 5abd7d1

Please sign in to comment.