Made Windows version of SDL_SetWindowBordered() mostly work.

The sizing still isn't quite right.
This commit is contained in:
Ryan C. Gordon
2012-09-14 13:14:20 -04:00
parent f36003f837
commit d62efa1877

View File

@@ -487,7 +487,18 @@ void
WIN_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
{
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
SetWindowLong(hwnd, GWL_STYLE, GetWindowStyle(window));
DWORD style = GetWindowLong(hwnd, GWL_STYLE);
if (bordered) {
style &= ~STYLE_BORDERLESS;
style |= STYLE_NORMAL;
} else {
style &= ~STYLE_NORMAL;
style |= STYLE_BORDERLESS;
}
SetWindowLong(hwnd, GWL_STYLE, style);
SetWindowPos(hwnd, hwnd, window->x, window->y, window->w, window->h, SWP_FRAMECHANGED | SWP_NOREPOSITION | SWP_NOZORDER |SWP_NOACTIVATE | SWP_NOSENDCHANGING);
}
void