diff --git a/source/lib/detect.cpp b/source/lib/detect.cpp index c5ad468411..74185e5bbb 100755 --- a/source/lib/detect.cpp +++ b/source/lib/detect.cpp @@ -36,6 +36,9 @@ #include "ogl.h" #include "wsdl.h" +#ifdef HAVE_X_WINDOWS +#include +#endif // useful for choosing a video mode. not called by detect(). // currently not implemented for non-Win32 systems (returns 800x600). @@ -51,6 +54,16 @@ void get_cur_resolution(int& xres, int& yres) xres = dm.dmPelsWidth; yres = dm.dmPelsHeight; #endif +#ifdef HAVE_X_WINDOWS + Display *disp=XOpenDisplay(NULL); + if (disp) + { + int screen=XDefaultScreen(disp); + xres=XDisplayWidth(disp, screen); + yres=XDisplayHeight(disp, screen); + XCloseDisplay(disp); + } +#endif }