From c4f1255e1e3d5c0abc0324d87c35c8c8f39d5480 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 30 Jul 2010 00:55:00 -0700 Subject: [PATCH] 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 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 421bcb33a..430d4e03b 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -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; }