summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2010-10-01 11:12:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2010-10-01 18:58:22 +0100
commit3cf1916947916699a6dff7460d1663c6cdd61760 (patch)
treebae74f43c62062d1c1bc051a270f5db562b7fa7f /vcl
parentee260a5c4ed11e9b99c62f3d58810da704387be5 (diff)
gtk_init_check sets XError/XIOError handlers, we want our own one
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 2679f4a29c02..46c4b8e5f7c7 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -489,6 +489,7 @@ class GtkXLib : public SalXLib
GSource *m_pUserEvent;
oslMutex m_aDispatchMutex;
oslCondition m_aDispatchCondition;
+ XIOErrorHandler m_aOrigGTKXIOErrorHandler;
public:
static gboolean timeoutFn(gpointer data);
@@ -522,6 +523,7 @@ GtkXLib::GtkXLib()
m_pUserEvent = NULL;
m_aDispatchCondition = osl_createCondition();
m_aDispatchMutex = osl_createMutex();
+ m_aOrigGTKXIOErrorHandler = NULL;
}
GtkXLib::~GtkXLib()
@@ -535,6 +537,9 @@ GtkXLib::~GtkXLib()
osl_setCondition( m_aDispatchCondition );
osl_destroyCondition( m_aDispatchCondition );
osl_destroyMutex( m_aDispatchMutex );
+
+ PopXErrorLevel();
+ XSetIOErrorHandler (m_aOrigGTKXIOErrorHandler);
}
void GtkXLib::Init()
@@ -596,6 +601,10 @@ void GtkXLib::Init()
// init gtk/gdk
gtk_init_check( &nParams, &pCmdLineAry );
+ //gtk_init_check sets XError/XIOError handlers, we want our own one
+ m_aOrigGTKXIOErrorHandler = XSetIOErrorHandler ( (XIOErrorHandler)X11SalData::XIOErrorHdl );
+ PushXErrorLevel( !!getenv( "SAL_IGNOREXERRORS" ) );
+
for (i = 0; i < nParams; i++ )
g_free( pCmdLineAry[i] );
delete [] pCmdLineAry;