changeset 4628:fad859023468

When querying the display size for a fullscreen window, the display size is the size of the fullscreen video mode.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 30 Jul 2010 00:55:00 -0700
parents 3b5f4b3a69e1
children 0a3bfd46c4db
files src/video/x11/SDL_x11window.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/x11/SDL_x11window.c	Thu Jul 29 20:24:05 2010 -0700
+++ b/src/video/x11/SDL_x11window.c	Fri Jul 30 00:55:00 2010 -0700
@@ -94,9 +94,15 @@
         (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;
     }