Commit 1e83a51b authored by Sam Lantinga's avatar Sam Lantinga

Removed obsolete window positioning code.

parent 4952e568
...@@ -62,26 +62,8 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) ...@@ -62,26 +62,8 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window)
bshaped = 1; bshaped = 1;
/* Fill the window description. */ /* Fill the window description. */
if (SDL_WINDOWPOS_ISCENTERED(window->x)) { x = window->x;
x = (dispdata->cw - window->w) / 2; y = window->y;
} else if (SDL_WINDOWPOS_ISUNDEFINED(window->x)) {
x = 0;
} else {
x = window->x;
}
if (SDL_WINDOWPOS_ISCENTERED(window->y)) {
y = (dispdata->ch - window->h) / 2;
} else if (SDL_WINDOWPOS_ISUNDEFINED(window->y)) {
y = 0;
} else {
y = window->y;
}
if (window->flags & SDL_WINDOW_FULLSCREEN) {
x = 0;
y = 0;
}
DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h); DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);
......
...@@ -345,7 +345,6 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window) ...@@ -345,7 +345,6 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window)
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
RECT rect; RECT rect;
SDL_Rect bounds;
DWORD style; DWORD style;
HWND top; HWND top;
BOOL menu; BOOL menu;
...@@ -371,18 +370,8 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window) ...@@ -371,18 +370,8 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window)
AdjustWindowRectEx(&rect, style, menu, 0); AdjustWindowRectEx(&rect, style, menu, 0);
w = (rect.right - rect.left); w = (rect.right - rect.left);
h = (rect.bottom - rect.top); h = (rect.bottom - rect.top);
x = window->x + rect.left;
WIN_GetDisplayBounds(_this, display, &bounds); y = window->y + rect.top;
if (SDL_WINDOWPOS_ISCENTERED(window->x)) {
x = bounds.x + (bounds.w - w) / 2;
} else {
x = window->x + rect.left;
}
if (SDL_WINDOWPOS_ISCENTERED(window->y)) {
y = bounds.y + (bounds.h - h) / 2;
} else {
y = window->y + rect.top;
}
SetWindowPos(hwnd, top, x, y, 0, 0, (SWP_NOCOPYBITS | SWP_NOSIZE)); SetWindowPos(hwnd, top, x, y, 0, 0, (SWP_NOCOPYBITS | SWP_NOSIZE));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment