diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.cpp b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.cpp index 2e15e40baa..d3a8bf8854 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.cpp +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.cpp @@ -2,6 +2,7 @@ #include "LowLevelWindow_X11.h" #include "RageLog.h" #include "RageException.h" +#include "ProductInfo.h" #include "archutils/Unix/X11Helper.h" #include @@ -17,6 +18,7 @@ extern Display *g_X11Display; LowLevelWindow_X11::LowLevelWindow_X11() { + m_bWindowIsOpen = false; g_X11Display = NULL; if( !X11Helper::Go() ) { @@ -61,10 +63,8 @@ CString LowLevelWindow_X11::TryVideoMode( RageDisplay::VideoModeParams p, bool & hints.min_width = hints.max_width = hints.base_width = p.width; hints.min_height = hints.max_height = hints.base_height = p.height; - if( !windowIsOpen || p.bpp != CurrentParams.bpp ) + if( !m_bWindowIsOpen || p.bpp != CurrentParams.bpp ) { - X11Helper::OpenMask( StructureNotifyMask ); - // Different depth, or we didn't make a window before. New context. bNewDeviceOut = true; @@ -101,9 +101,9 @@ CString LowLevelWindow_X11::TryVideoMode( RageDisplay::VideoModeParams p, bool & { return "Failed to create the window."; } - windowIsOpen = true; + m_bWindowIsOpen = true; - char WindowTitle[] = "StepMania"; + char WindowTitle[] = PRODUCT_NAME; XChangeProperty( g_X11Display, X11Helper::Win, XA_WM_NAME, XA_STRING, 8, PropModeReplace, reinterpret_cast(WindowTitle), strlen(WindowTitle) ); @@ -111,6 +111,9 @@ CString LowLevelWindow_X11::TryVideoMode( RageDisplay::VideoModeParams p, bool & glXMakeCurrent( X11Helper::Dpy, X11Helper::Win, ctxt ); + /* Enable StructureNotifyMask, so we receive a MapNotify for the following XMapWindow. */ + X11Helper::OpenMask( StructureNotifyMask ); + XMapWindow( X11Helper::Dpy, X11Helper::Win ); // HACK: Wait for the MapNotify event, without spinning and diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.h b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.h index adf3a77aae..0239ec7119 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.h +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_X11.h @@ -1,13 +1,14 @@ +/* LowLevelWindow_X11 - OpenGL GLX window driver. */ + #ifndef LOW_LEVEL_WINDOW_X11_H #define LOW_LEVEL_WINDOW_X11_H -/* A nice, simple OpenGL window direct to X11 through Xlib. */ #include "LowLevelWindow.h" class LowLevelWindow_X11 : public LowLevelWindow { private: - bool windowIsOpen; + bool m_bWindowIsOpen; RageDisplay::VideoModeParams CurrentParams; public: