mirror of
https://github.com/yawut/SDL.git
synced 2026-08-26 18:55:32 -05:00
When querying the display size for a fullscreen window, the display size is the size of the fullscreen video mode.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user