Theoretically fixed the position of the child window, though it's always ending up at the upper left corner for some reason.
authorSam Lantinga
Fri, 28 Sep 2012 10:54:26 -0700
changeset 65012efafb933bd5
parent 6500 c532b3fdce27
child 6502 f41a82de351e
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
     1.1 --- a/src/video/x11/SDL_x11window.c	Fri Sep 28 10:24:28 2012 -0700
     1.2 +++ b/src/video/x11/SDL_x11window.c	Fri Sep 28 10:54:26 2012 -0700
     1.3 @@ -1032,13 +1032,12 @@
     1.4      SetWindowBordered(display, displaydata->screen, data->xwindow, SDL_FALSE);
     1.5  
     1.6      /* Center actual window within our cover-the-screen window. */
     1.7 -    rect.x += (rect.w - window->w) / 2;
     1.8 -    rect.y += (rect.h - window->h) / 2;
     1.9 -    XReparentWindow(display, data->xwindow, data->fswindow, rect.x, rect.y);
    1.10 +    XReparentWindow(display, data->xwindow, data->fswindow,
    1.11 +                    (rect.w - window->w) / 2, (rect.h - window->h) / 2);
    1.12  
    1.13 -    /* Center mouse in the window. */
    1.14 -    rect.x += (window->w / 2);
    1.15 -    rect.y += (window->h / 2);
    1.16 +    /* Center mouse in the fullscreen window. */
    1.17 +    rect.x += (rect.w / 2);
    1.18 +    rect.y += (rect.h / 2);
    1.19      XWarpPointer(display, None, root, 0, 0, 0, 0, rect.x, rect.y);
    1.20  
    1.21      /* Wait to be mapped, filter Unmap event out if it arrives. */