From a41528bc9d9ad834c83830d93a595ab80140fbe1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 28 Sep 2012 10:54:26 -0700 Subject: [PATCH] Theoretically fixed the position of the child window, though it's always ending up at the upper left corner for some reason. --- src/video/x11/SDL_x11window.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 5fab13684..bdce26acf 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -1032,13 +1032,12 @@ X11_BeginWindowFullscreenLegacy(_THIS, SDL_Window * window, SDL_VideoDisplay * _ SetWindowBordered(display, displaydata->screen, data->xwindow, SDL_FALSE); /* Center actual window within our cover-the-screen window. */ - rect.x += (rect.w - window->w) / 2; - rect.y += (rect.h - window->h) / 2; - XReparentWindow(display, data->xwindow, data->fswindow, rect.x, rect.y); + XReparentWindow(display, data->xwindow, data->fswindow, + (rect.w - window->w) / 2, (rect.h - window->h) / 2); - /* Center mouse in the window. */ - rect.x += (window->w / 2); - rect.y += (window->h / 2); + /* Center mouse in the fullscreen window. */ + rect.x += (rect.w / 2); + rect.y += (rect.h / 2); XWarpPointer(display, None, root, 0, 0, 0, 0, rect.x, rect.y); /* Wait to be mapped, filter Unmap event out if it arrives. */