From 7ef3d3e6bbd1f96e882711c81a63fe9fe7396194 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 14 Jun 2004 05:50:40 +0000 Subject: [PATCH] set g_X11Display --- .../LowLevelWindow/LowLevelWindow_SDL.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp index ca2a048657..53bc67d1db 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_SDL.cpp @@ -5,6 +5,14 @@ #include "RageDisplay.h" // for REFRESH_DEFAULT #include "StepMania.h" +#if defined(UNIX) +#include +#endif + +#if defined(UNIX) +extern Display *g_X11Display; +#endif + LowLevelWindow_SDL::LowLevelWindow_SDL() { /* By default, ignore all SDL events. We'll enable them as we need them. @@ -182,6 +190,19 @@ CString LowLevelWindow_SDL::TryVideoMode( RageDisplay::VideoModeParams p, bool & /* Recreating the window changes the hwnd. */ SDL_UpdateHWnd(); +#if defined(unix) + { + SDL_SysWMinfo info; + SDL_VERSION(&info.version); + + g_X11Display = NULL; + if ( SDL_GetWMInfo(&info) < 0 ) + LOG->Warn("SDL_GetWMInfo failed: %s", SDL_GetError()); + else + g_X11Display = info.info.x11.display; + } +#endif + { /* Find out what we really got. */ int r,g,b,a, colorbits, depth, stencil;