Need help with fdo#50920

Ruslan Kabatsayev b7.10110111 at gmail.com
Sun Jun 17 17:58:05 PDT 2012


Hello,

As I've found with fdo#50920, if I've understood
XConvertSelection/SelectionNotify mechanism correctly, it's selection
owner (Mathematica in this case) who converts the selection to our
target type, and it appears that last (15th) atom is always corrupt
with Mathematica. Qt and GEN plugins don't have these crashes because
they don't abort() on X errors. So, it seems we should just use
gdk_error_trap_push() to prevent crashes with GTK plugin.
So, below is a trivial patch which solves two cases of crashes with
Mathematica. But I now have a question: should we maybe just call
gdk_error_trap_push() on GTK initialization and just ignore any X
errors in any context, or should we limit at what the patch does?

diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 4d58110..86d3f56 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -839,8 +839,10 @@ extern "C" {
         sal_gtk_timeout_defer( pTSource );

         ImplSVData* pSVData = ImplGetSVData();
+        gdk_error_trap_push();
         if( pSVData->mpSalTimer )
             pSVData->mpSalTimer->CallCallback();
+        gdk_error_trap_pop();

         return TRUE;
     }
@@ -941,7 +943,9 @@ gboolean GtkData::userEventFn( gpointer data )

         pThis->GetGtkDisplay()->EventGuardRelease();

+        gdk_error_trap_push();
         pThis->GetGtkDisplay()->DispatchInternalEvent();
+        gdk_error_trap_pop();
     }

     return bContinue;


Regards,
Ruslan


More information about the LibreOffice mailing list