[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara caolanm at redhat.com
Fri Jul 17 06:03:01 PDT 2015


 vcl/unx/gtk/app/gtkdata.cxx |   22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 9dd4b06304a615d2d600d6b1cdf0d6d445311b0d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 17 12:02:00 2015 +0100

    presumably XSetIOErrorHandler is meaningless on wayland
    
    Change-Id: I72247a38021b11a521d785f7565c218a425a857f

diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 6e0f711..b1e552b 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -47,9 +47,12 @@
 #include <vcl/svapp.hxx>
 
 #if GTK_CHECK_VERSION(3,10,0)
-#ifdef GDK_WINDOWING_X11
-#include <gdk/gdkx.h>
-#endif
+# ifdef GDK_WINDOWING_X11
+#  include <gdk/gdkx.h>
+# endif
+#else
+# define GDK_WINDOWING_X11
+# define GDK_IS_X11_DISPLAY(foo) true
 #endif
 
 using namespace vcl_sal;
@@ -525,6 +528,7 @@ GtkData::GtkData( SalInstance *pInstance )
     m_aDispatchCondition = osl_createCondition();
 }
 
+#if defined(GDK_WINDOWING_X11)
 XIOErrorHandler aOrigXIOErrorHandler = NULL;
 
 extern "C" {
@@ -538,6 +542,7 @@ static int XIOErrorHdl(Display *)
 }
 
 }
+#endif
 
 GtkData::~GtkData()
 {
@@ -558,7 +563,10 @@ GtkData::~GtkData()
     osl_destroyCondition( m_aDispatchCondition );
     osl_releaseMutex( m_aDispatchMutex );
     osl_destroyMutex( m_aDispatchMutex );
-    XSetIOErrorHandler(aOrigXIOErrorHandler);
+#if defined(GDK_WINDOWING_X11)
+    if (GDK_IS_X11_DISPLAY(gdk_display_get_default()))
+        XSetIOErrorHandler(aOrigXIOErrorHandler);
+#endif
 }
 
 void GtkData::Dispose()
@@ -679,7 +687,6 @@ void GtkData::Init()
     // init gtk/gdk
     gtk_init_check( &nParams, &pCmdLineAry );
     gdk_error_trap_push();
-    aOrigXIOErrorHandler = XSetIOErrorHandler(XIOErrorHdl);
 
     for (i = 0; i < nParams; i++ )
         g_free( pCmdLineAry[i] );
@@ -709,6 +716,11 @@ void GtkData::Init()
         exit(0);
     }
 
+#if defined(GDK_WINDOWING_X11)
+    if (GDK_IS_X11_DISPLAY(pGdkDisp))
+        aOrigXIOErrorHandler = XSetIOErrorHandler(XIOErrorHdl);
+#endif
+
     /*
      * if a -display switch was used, we need
      * to set the environment accoringly since


More information about the Libreoffice-commits mailing list