- Fixing rendering borderless window. Need to force windows to send a WM_NCCALCSIZE then return 0 for non-client area size.

- Adding WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX to borderless windows, for reasons noted in comments.

- Fix SetupWindowData() setting SDL_WINDOW_BORDERLESS. This was being cleared at window creation, causing hanlding for the first WM_NCCALCSIZE message to fail
This commit is contained in:
Sam Lantinga
2017-09-22 07:11:36 -07:00
parent cc023b6b81
commit 3176a7f5e9
2 changed files with 20 additions and 5 deletions

View File

@@ -949,6 +949,14 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
break;
case WM_NCCALCSIZE:
{
// When borderless, need to tell windows that the size of the non-client area is 0
if ( wParam == TRUE && SDL_GetWindowFlags( data->window ) & SDL_WINDOW_BORDERLESS )
return 0;
}
break;
case WM_NCHITTEST:
{
SDL_Window *window = data->window;
@@ -976,7 +984,6 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
}
break;
}
/* If there's a window proc, assume it's going to handle messages */