When querying the display size for a fullscreen window, the display size is the size of the fullscreen video mode.
authorSam Lantinga <slouken@libsdl.org>
Fri, 30 Jul 2010 00:55:00 -0700
changeset 4628fad859023468
parent 4627 3b5f4b3a69e1
child 4631 0a3bfd46c4db
When querying the display size for a fullscreen window, the display size is the size of the fullscreen video mode.
src/video/x11/SDL_x11window.c
     1.1 --- a/src/video/x11/SDL_x11window.c	Thu Jul 29 20:24:05 2010 -0700
     1.2 +++ b/src/video/x11/SDL_x11window.c	Fri Jul 30 00:55:00 2010 -0700
     1.3 @@ -94,9 +94,15 @@
     1.4          (SDL_DisplayData *) window->display->driverdata;
     1.5      XWindowAttributes attr;
     1.6  
     1.7 -    XGetWindowAttributes(data->display, RootWindow(data->display,
     1.8 -                                                   displaydata->screen),
     1.9 -                         &attr);
    1.10 +    XGetWindowAttributes(data->display, RootWindow(data->display, displaydata->screen), &attr);
    1.11 +    if (window->flags & SDL_WINDOW_FULLSCREEN) {
    1.12 +        /* The bounds when this window is visible is the fullscreen mode */
    1.13 +        SDL_DisplayMode fullscreen_mode;
    1.14 +        if (SDL_GetWindowDisplayMode(window, &fullscreen_mode) == 0) {
    1.15 +            attr.width = fullscreen_mode.w;
    1.16 +            attr.height = fullscreen_mode.h;
    1.17 +        }
    1.18 +    }
    1.19      if (w) {
    1.20          *w = attr.width;
    1.21      }