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

Commit

Permalink
When querying the display size for a fullscreen window, the display s…
Browse files Browse the repository at this point in the history
…ize is the size of the fullscreen video mode.
  • Loading branch information
slouken committed Jul 30, 2010
1 parent 8a42721 commit c4f1255
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/video/x11/SDL_x11window.c
Expand Up @@ -94,9 +94,15 @@ X11_GetDisplaySize(_THIS, SDL_Window * window, int *w, int *h)
(SDL_DisplayData *) window->display->driverdata;
XWindowAttributes attr;

XGetWindowAttributes(data->display, RootWindow(data->display,
displaydata->screen),
&attr);
XGetWindowAttributes(data->display, RootWindow(data->display, displaydata->screen), &attr);
if (window->flags & SDL_WINDOW_FULLSCREEN) {
/* The bounds when this window is visible is the fullscreen mode */
SDL_DisplayMode fullscreen_mode;
if (SDL_GetWindowDisplayMode(window, &fullscreen_mode) == 0) {
attr.width = fullscreen_mode.w;
attr.height = fullscreen_mode.h;
}
}
if (w) {
*w = attr.width;
}
Expand Down

0 comments on commit c4f1255

Please sign in to comment.