Made Windows version of SDL_SetWindowBordered() mostly work.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 14 Sep 2012 13:14:20 -0400
changeset 64280028fa91dfc6
parent 6427 34059553702a
child 6429 ff5e34883bf8
Made Windows version of SDL_SetWindowBordered() mostly work.

The sizing still isn't quite right.
src/video/windows/SDL_windowswindow.c
     1.1 --- a/src/video/windows/SDL_windowswindow.c	Fri Sep 14 13:13:47 2012 -0400
     1.2 +++ b/src/video/windows/SDL_windowswindow.c	Fri Sep 14 13:14:20 2012 -0400
     1.3 @@ -487,7 +487,18 @@
     1.4  WIN_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
     1.5  {
     1.6      HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
     1.7 -    SetWindowLong(hwnd, GWL_STYLE, GetWindowStyle(window));
     1.8 +    DWORD style = GetWindowLong(hwnd, GWL_STYLE);
     1.9 +
    1.10 +    if (bordered) {
    1.11 +        style &= ~STYLE_BORDERLESS;
    1.12 +        style |= STYLE_NORMAL;
    1.13 +    } else {
    1.14 +        style &= ~STYLE_NORMAL;
    1.15 +        style |= STYLE_BORDERLESS;
    1.16 +    }
    1.17 +
    1.18 +    SetWindowLong(hwnd, GWL_STYLE, style);
    1.19 +    SetWindowPos(hwnd, hwnd, window->x, window->y, window->w, window->h, SWP_FRAMECHANGED | SWP_NOREPOSITION | SWP_NOZORDER |SWP_NOACTIVATE | SWP_NOSENDCHANGING);
    1.20  }
    1.21  
    1.22  void