diff --git a/stepmania/src/archutils/Unix/X11Helper.cpp b/stepmania/src/archutils/Unix/X11Helper.cpp index 653aea91af..21f9bbc573 100644 --- a/stepmania/src/archutils/Unix/X11Helper.cpp +++ b/stepmania/src/archutils/Unix/X11Helper.cpp @@ -88,8 +88,6 @@ static bool pApplyMasks() bool X11Helper::MakeWindow( int screenNum, int depth, Visual *visual, int width, int height, bool overrideRedirect ) { - vector::iterator i; - if( g_iRefCount == 0 ) return false; @@ -101,6 +99,17 @@ bool X11Helper::MakeWindow( int screenNum, int depth, Visual *visual, int width, // pHaveWin will stay false if an error occurs once I do error // checking here... + Window Win = CreateWindow( screenNum, depth, visual, width, height, overrideRedirect ); + + g_bHaveWin = true; + + return true; +} + +Window X11Helper::CreateWindow( int screenNum, int depth, Visual *visual, int width, int height, bool overrideRedirect ) +{ + vector::iterator i; + XSetWindowAttributes winAttribs; winAttribs.border_pixel = 0; @@ -116,6 +125,7 @@ bool X11Helper::MakeWindow( int screenNum, int depth, Visual *visual, int width, winAttribs.colormap = XCreateColormap( Dpy, RootWindow(Dpy, screenNum), visual, AllocNone ); + Window Win; if( overrideRedirect ) { winAttribs.override_redirect = True; @@ -129,9 +139,6 @@ bool X11Helper::MakeWindow( int screenNum, int depth, Visual *visual, int width, height, 0, depth, InputOutput, visual, CWBorderPixel | CWColormap | CWEventMask, &winAttribs ); } - - - g_bHaveWin = true; /* Hide the mouse cursor. */ { @@ -146,7 +153,7 @@ bool X11Helper::MakeWindow( int screenNum, int depth, Visual *visual, int width, XFreeCursor( Dpy, pBlankPointer ); } - return true; + return Win; } int protoErrorCallback( Display *d, XErrorEvent *err ) diff --git a/stepmania/src/archutils/Unix/X11Helper.h b/stepmania/src/archutils/Unix/X11Helper.h index d2ee5be971..0ba29c7991 100644 --- a/stepmania/src/archutils/Unix/X11Helper.h +++ b/stepmania/src/archutils/Unix/X11Helper.h @@ -30,6 +30,8 @@ namespace X11Helper bool MakeWindow(int screenNum, int depth, Visual *visual, int width=32, int height=32, bool overrideRedirect=false); + Window CreateWindow( int screenNum, int depth, Visual *visual, int width, int height, bool overrideRedirect ); + // Unmask one X event type mask thingy (XSelectInput() arg 3) on the // current window. Masked/unmasked events will carry between windows. bool OpenMask(long mask);