Mercurial > sdl-ios-xcode
diff src/video/win32/SDL_win32window.c @ 2875:91a7e08cd238
* Implemented X11 fullscreen input grab
* Progress towards being able to toggle in and out of fullscreen mode
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 17 Dec 2008 07:17:54 +0000 |
parents | 09adf4854163 |
children | 3fcb0d447bcd |
line wrap: on
line diff
--- a/src/video/win32/SDL_win32window.c Tue Dec 16 17:44:10 2008 +0000 +++ b/src/video/win32/SDL_win32window.c Wed Dec 17 07:17:54 2008 +0000 @@ -159,12 +159,12 @@ int x, y; int w, h; - if (window->flags & SDL_WINDOW_BORDERLESS) { + if (window->flags & (SDL_WINDOW_BORDERLESS|SDL_WINDOW_FULLSCREEN)) { style |= WS_POPUP; } else { style |= (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX); } - if (window->flags & SDL_WINDOW_RESIZABLE) { + if ((window->flags & SDL_WINDOW_RESIZABLE) && !(window->flags & SDL_WINDOW_FULLSCREEN)) { style |= (WS_THICKFRAME | WS_MAXIMIZEBOX); } @@ -182,14 +182,14 @@ w = (rect.right - rect.left); h = (rect.bottom - rect.top); - if (window->x == SDL_WINDOWPOS_CENTERED) { + if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) { x = (GetSystemMetrics(SM_CXSCREEN) - w) / 2; } else if (window->x == SDL_WINDOWPOS_UNDEFINED) { x = CW_USEDEFAULT; } else { x = window->x + rect.left; } - if (window->y == SDL_WINDOWPOS_CENTERED) { + if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->y == SDL_WINDOWPOS_CENTERED) { y = (GetSystemMetrics(SM_CYSCREEN) - h) / 2; } else if (window->y == SDL_WINDOWPOS_UNDEFINED) { y = CW_USEDEFAULT; @@ -331,8 +331,17 @@ AdjustWindowRectEx(&rect, style, (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL), 0); - x = window->x + rect.left; - y = window->y + rect.top; + + if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) { + x = (GetSystemMetrics(SM_CXSCREEN) - window->w) / 2; + } else { + x = window->x + rect.left; + } + if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->y == SDL_WINDOWPOS_CENTERED) { + y = (GetSystemMetrics(SM_CYSCREEN) - window->h) / 2; + } else { + y = window->y + rect.top; + } SetWindowPos(hwnd, top, x, y, 0, 0, (SWP_NOCOPYBITS | SWP_NOSIZE)); } @@ -425,7 +434,7 @@ { HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; - if ((window->flags & SDL_WINDOW_INPUT_GRABBED) && + if ((window->flags & (SDL_WINDOW_INPUT_GRABBED|SDL_WINDOW_FULLSCREEN)) && (window->flags & SDL_WINDOW_INPUT_FOCUS)) { RECT rect; GetClientRect(hwnd, &rect);