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

Commit

Permalink
Fixed bug 1848 - SDL_SetWindowSize cannot set sizes larger than deskt…
Browse files Browse the repository at this point in the history
…op resolution in Windows
  • Loading branch information
slouken committed Aug 7, 2013
1 parent 6437a1d commit 83da1c5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/video/windows/SDL_windowswindow.c
Expand Up @@ -131,8 +131,15 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
{
RECT rect;
if (GetClientRect(hwnd, &rect)) {
window->w = rect.right;
window->h = rect.bottom;
int w = rect.right;
int h = rect.bottom;
if ((window->w && window->w != w) || (window->h && window->h != h)) {
// We tried to create a window larger than the desktop and Windows didn't allow it. Override!
SetWindowPos(hwnd, NULL, 0, 0, window->w, window->h, SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
} else {
window->w = w;
window->h = h;
}
}
}
{
Expand Down

0 comments on commit 83da1c5

Please sign in to comment.