Return values not used.

This commit is contained in:
Steve Checkoway
2006-12-07 08:31:40 +00:00
parent e03934c21f
commit 19cee71210
2 changed files with 17 additions and 22 deletions
+11 -16
View File
@@ -19,8 +19,8 @@ static bool g_bHaveWin = false;
Display *X11Helper::Dpy = NULL; Display *X11Helper::Dpy = NULL;
Window X11Helper::Win; Window X11Helper::Win;
int protoErrorCallback( Display*, XErrorEvent* ); static int protoErrorCallback( Display*, XErrorEvent* );
int protoFatalCallback( Display* ); static int protoFatalCallback( Display* );
bool X11Helper::Go() bool X11Helper::Go()
{ {
@@ -34,7 +34,6 @@ bool X11Helper::Go()
XSetErrorHandler( &protoErrorCallback ); XSetErrorHandler( &protoErrorCallback );
} }
g_iRefCount++; g_iRefCount++;
return true; return true;
} }
@@ -50,29 +49,28 @@ void X11Helper::Stop()
} }
} }
static bool pApplyMasks(); static void pApplyMasks();
bool X11Helper::OpenMask( long mask ) void X11Helper::OpenMask( long mask )
{ {
g_aiMasks.push_back(mask); g_aiMasks.push_back(mask);
return pApplyMasks(); pApplyMasks();
} }
bool X11Helper::CloseMask( long mask ) void X11Helper::CloseMask( long mask )
{ {
vector<long>::iterator i = find( g_aiMasks.begin(), g_aiMasks.end(), mask ); vector<long>::iterator i = find( g_aiMasks.begin(), g_aiMasks.end(), mask );
if( i == g_aiMasks.end() ) if( i == g_aiMasks.end() )
return true; return;
g_aiMasks.erase( i ); g_aiMasks.erase( i );
pApplyMasks();
return pApplyMasks();
} }
static bool pApplyMasks() static void pApplyMasks()
{ {
if( X11Helper::Dpy == NULL || !g_bHaveWin ) if( X11Helper::Dpy == NULL || !g_bHaveWin )
return true; return;
LOG->Trace("X11Helper: Reapplying event masks."); LOG->Trace("X11Helper: Reapplying event masks.");
@@ -80,10 +78,7 @@ static bool pApplyMasks()
for( unsigned i = 0; i < g_aiMasks.size(); ++i ) for( unsigned i = 0; i < g_aiMasks.size(); ++i )
iMask |= g_aiMasks[i]; iMask |= g_aiMasks[i];
if( XSelectInput(X11Helper::Dpy, X11Helper::Win, iMask) == 0 ) XSelectInput( X11Helper::Dpy, X11Helper::Win, iMask );
return false;
return true;
} }
bool X11Helper::MakeWindow( int screenNum, int depth, Visual *visual, int width, int height, bool overrideRedirect ) bool X11Helper::MakeWindow( int screenNum, int depth, Visual *visual, int width, int height, bool overrideRedirect )
+6 -6
View File
@@ -15,6 +15,10 @@ namespace X11Helper
// internal session-tracking stuff (so you should call this anyway). // internal session-tracking stuff (so you should call this anyway).
bool Go(); bool Go();
// Destroy the connection, if appropriate; otherwise do some important
// internal session-tracking stuff (so you should call it anyway).
void Stop();
// The current Display (connection). Initialized by the first call to // The current Display (connection). Initialized by the first call to
// Go(). // Go().
extern Display *Dpy; extern Display *Dpy;
@@ -34,15 +38,11 @@ namespace X11Helper
// Unmask one X event type mask thingy (XSelectInput() arg 3) on the // Unmask one X event type mask thingy (XSelectInput() arg 3) on the
// current window. Masked/unmasked events will carry between windows. // current window. Masked/unmasked events will carry between windows.
bool OpenMask(long mask); void OpenMask( long mask );
// (Re)mask one X event type mask thingy (XSelectInput() arg 3) on the // (Re)mask one X event type mask thingy (XSelectInput() arg 3) on the
// current window. Masked/unmasked events will carry between windows. // current window. Masked/unmasked events will carry between windows.
bool CloseMask(long mask); void CloseMask( long mask );
// Destroy the connection, if appropriate; otherwise do some important
// internal session-tracking stuff (so you should call it anyway).
void Stop();
}; };
#endif #endif