diff options
author | Michael Meeks <michael.meeks@suse.com> | 2011-10-03 16:36:26 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2011-10-25 13:41:52 +0100 |
commit | c529623457889a67473f773d080941903e2784fc (patch) | |
tree | a8a41cbb19a3063d10c22db8e6fe6d5dddc5960b /vcl/unx/gtk/app/gtkdata.cxx | |
parent | f88ff49c733392e66dd178928efa3d807f2cffca (diff) |
generic: re-work X error push/pop and error message handling
Diffstat (limited to 'vcl/unx/gtk/app/gtkdata.cxx')
-rw-r--r-- | vcl/unx/gtk/app/gtkdata.cxx | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 5f39bd9c9053..52b7166c2899 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -99,7 +99,7 @@ GtkSalDisplay::GtkSalDisplay( GdkDisplay* pDisplay ) : gdk_window_add_filter( NULL, call_filterGdkEvent, this ); if ( getenv( "SAL_IGNOREXERRORS" ) ) - errorTrapPush(); // and leak the trap + GetGenericData()->ErrorTrapPush(); // and leak the trap } GtkSalDisplay::~GtkSalDisplay() @@ -119,20 +119,6 @@ GtkSalDisplay::~GtkSalDisplay() gdk_cursor_unref( m_aCursors[ i ] ); } -void GtkSalDisplay::errorTrapPush() -{ - gdk_error_trap_push (); -} - -void GtkSalDisplay::errorTrapPop() -{ -#if !GTK_CHECK_VERSION(3,0,0) - gdk_error_trap_pop (); -#else - gdk_error_trap_pop_ignored (); // faster -#endif -} - extern "C" { void signalKeysChanged( GdkKeymap*, gpointer data ) @@ -773,6 +759,25 @@ void GtkData::Init() } } +void GtkData::ErrorTrapPush() +{ + gdk_error_trap_push (); +} + +bool GtkData::ErrorTrapPop( bool bIgnoreError ) +{ +#if GTK_CHECK_VERSION(3,0,0) + if( bIgnoreError ) + { + gdk_error_trap_pop_ignored (); // faster + return false; + } +#else + (void) bIgnoreError; +#endif + return gdk_error_trap_pop () != 0; +} + GtkSalTimer::GtkSalTimer() : m_pTimeout( 0 ) { |