Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Made Windows version of SDL_SetWindowBordered() mostly work.
The sizing still isn't quite right.
  • Loading branch information
icculus committed Sep 14, 2012
1 parent e7d3674 commit f16652c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/video/windows/SDL_windowswindow.c
Expand Up @@ -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
Expand Down

0 comments on commit f16652c

Please sign in to comment.