src/video/windows/SDL_windowswindow.c
changeset 9886 adb374e144d6
parent 9665 8d24b4bfa3dd
child 9888 bf49de980798
     1.1 --- a/src/video/windows/SDL_windowswindow.c	Wed Sep 30 16:00:21 2015 -0700
     1.2 +++ b/src/video/windows/SDL_windowswindow.c	Thu Oct 01 11:21:06 2015 -0700
     1.3 @@ -109,7 +109,7 @@
     1.4      y = window->y + rect.top;
     1.5  
     1.6      data->expected_resize = SDL_TRUE;
     1.7 -    SetWindowPos( hwnd, top, x, y, w, h, flags );
     1.8 +    SetWindowPos(hwnd, top, x, y, w, h, flags);
     1.9      data->expected_resize = SDL_FALSE;
    1.10  }
    1.11  
    1.12 @@ -165,7 +165,26 @@
    1.13              int h = rect.bottom;
    1.14              if ((window->w && window->w != w) || (window->h && window->h != h)) {
    1.15                  /* We tried to create a window larger than the desktop and Windows didn't allow it.  Override! */
    1.16 -                WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE);
    1.17 +                RECT rect;
    1.18 +                DWORD style;
    1.19 +                BOOL menu;
    1.20 +                int x, y;
    1.21 +                int w, h;
    1.22 +
    1.23 +                /* Figure out what the window area will be */
    1.24 +                style = GetWindowLong(hwnd, GWL_STYLE);
    1.25 +                rect.left = 0;
    1.26 +                rect.top = 0;
    1.27 +                rect.right = window->w;
    1.28 +                rect.bottom = window->h;
    1.29 +                menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
    1.30 +                AdjustWindowRectEx(&rect, style, menu, 0);
    1.31 +                w = (rect.right - rect.left);
    1.32 +                h = (rect.bottom - rect.top);
    1.33 +                x = window->x + rect.left;
    1.34 +                y = window->y + rect.top;
    1.35 +
    1.36 +                SetWindowPos(hwnd, HWND_NOTOPMOST, x, y, w, h, SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE);
    1.37              } else {
    1.38                  window->w = w;
    1.39                  window->h = h;
    1.40 @@ -492,7 +511,7 @@
    1.41      }
    1.42  
    1.43      data->in_border_change = SDL_TRUE;
    1.44 -    SetWindowLong( hwnd, GWL_STYLE, style );
    1.45 +    SetWindowLong(hwnd, GWL_STYLE, style);
    1.46      WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE);
    1.47      data->in_border_change = SDL_FALSE;
    1.48  }