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

Commit

Permalink
Theoretically fixed the position of the child window, though it's alw…
Browse files Browse the repository at this point in the history
…ays ending up at the upper left corner for some reason.
  • Loading branch information
slouken committed Sep 28, 2012
1 parent db98e26 commit a41528b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/video/x11/SDL_x11window.c
Expand Up @@ -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. */
Expand Down

0 comments on commit a41528b

Please sign in to comment.