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

Commit

Permalink
Removed obsolete window positioning code.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 16, 2011
1 parent acd10b9 commit b7161c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 33 deletions.
22 changes: 2 additions & 20 deletions src/video/directfb/SDL_DirectFB_window.c
Expand Up @@ -62,26 +62,8 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window)
bshaped = 1;

/* Fill the window description. */
if (SDL_WINDOWPOS_ISCENTERED(window->x)) {
x = (dispdata->cw - window->w) / 2;
} 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;
}
x = window->x;
y = window->y;

DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);

Expand Down
15 changes: 2 additions & 13 deletions src/video/windows/SDL_windowswindow.c
Expand Up @@ -345,7 +345,6 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window)
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
RECT rect;
SDL_Rect bounds;
DWORD style;
HWND top;
BOOL menu;
Expand All @@ -371,18 +370,8 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window)
AdjustWindowRectEx(&rect, style, menu, 0);
w = (rect.right - rect.left);
h = (rect.bottom - rect.top);

WIN_GetDisplayBounds(_this, display, &bounds);
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;
}
x = window->x + rect.left;
y = window->y + rect.top;

SetWindowPos(hwnd, top, x, y, 0, 0, (SWP_NOCOPYBITS | SWP_NOSIZE));
}
Expand Down

0 comments on commit b7161c8

Please sign in to comment.