Made Windows version of SDL_SetWindowBordered() mostly work.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 14 Sep 2012 13:14:20 -0400
changeset 6428 0028fa91dfc6
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
--- a/src/video/windows/SDL_windowswindow.c	Fri Sep 14 13:13:47 2012 -0400
+++ b/src/video/windows/SDL_windowswindow.c	Fri Sep 14 13:14:20 2012 -0400
@@ -487,7 +487,18 @@
 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