split out CreateWindow

This commit is contained in:
Glenn Maynard
2006-01-27 08:17:29 +00:00
parent f09aee93b8
commit 24e016c397
2 changed files with 15 additions and 6 deletions
+13 -6
View File
@@ -88,8 +88,6 @@ static bool pApplyMasks()
bool X11Helper::MakeWindow( int screenNum, int depth, Visual *visual, int width, int height, bool overrideRedirect )
{
vector<long>::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<long>::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 )
+2
View File
@@ -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);