[Libreoffice-commits] .: Branch 'feature/gtk3' - 2 commits - vcl/unx

Michael Meeks michael at kemper.freedesktop.org
Fri Oct 21 07:49:38 PDT 2011


 vcl/unx/gtk/a11y/atkwindow.cxx  |    2 ++
 vcl/unx/gtk/app/gtkdata.cxx     |    1 +
 vcl/unx/gtk/app/gtkinst.cxx     |   30 ++++++++++++++++++++++--------
 vcl/unx/gtk/window/gtkframe.cxx |    2 ++
 4 files changed, 27 insertions(+), 8 deletions(-)

New commits:
commit 8cce65b1460582b9275ea0f982a61a9f621868b2
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri Oct 21 15:47:23 2011 +0100

    gtk3: caveats on using g_main_prepare for older glibs; needs re-work

diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index b5b70c0..67b480d 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -585,17 +585,31 @@ void GtkInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
 bool GtkInstance::IsTimerExpired()
 {
     gint nPriority;
+    bool bRet = false;
     GMainContext *pCtx = g_main_context_default();
-    // sets time_is_fresh to FALSE
-    if( !g_main_context_prepare( pCtx, &nPriority ) )
-        return false;
-    for( std::vector<GtkSalTimer *>::iterator it = m_aTimers.begin();
-         it != m_aTimers.end(); ++it )
+
+    if( !g_main_context_acquire( pCtx ) )
+        return false; // some other thread is waiting still ...
+
+    // FIXME: we need to re-work this to do our own timeouts to avoid
+    // warnings from older glib's about poll_waiting etc.
+
+    // sets GMainContext's time_is_fresh to FALSE
+    if( g_main_context_prepare( pCtx, &nPriority ) )
     {
-        if( (*it)->Expired() )
-            return true;
+        for( std::vector<GtkSalTimer *>::iterator it = m_aTimers.begin();
+             it != m_aTimers.end(); ++it )
+        {
+            if( (*it)->Expired() )
+            {
+                bRet = true;
+                break;
+            }
+        }
     }
-    return false;
+    g_main_context_release( pCtx );
+
+    return bRet;
 }
 
 bool GtkInstance::AnyInput( sal_uInt16 nType )
commit 23145073c79c1313b20ad21a4bc1e0e39550e666
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri Oct 21 15:27:17 2011 +0100

    gtk3: add some missing SolarMutexGuards (thanks to mst for noticing)

diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx
index 2cedf59..6970f0d 100644
--- a/vcl/unx/gtk/a11y/atkwindow.cxx
+++ b/vcl/unx/gtk/a11y/atkwindow.cxx
@@ -30,6 +30,7 @@
 #include "precompiled_vcl.hxx"
 
 #include <unx/gtk/gtkframe.hxx>
+#include <vcl/svapp.hxx>
 #include <vcl/window.hxx>
 #include "vcl/popupmenuwindow.hxx"
 
@@ -131,6 +132,7 @@ init_from_window( AtkObject *accessible, Window *pWindow )
 static gint
 ooo_window_wrapper_clear_focus(gpointer)
 {
+    SolarMutexGuard aGuard;
     atk_focus_tracker_notify( NULL );
     return FALSE;
 }
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index ad417f1..b50f859 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -880,6 +880,7 @@ gboolean GtkData::userEventFn( gpointer data )
 extern "C" {
     static gboolean call_userEventFn( void *data )
     {
+        SolarMutexGuard aGuard;
         return GtkData::userEventFn( data );
     }
 }
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 3ab7840..87d1f49 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -3219,6 +3219,8 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
 extern "C" {
 gboolean implDelayedFullScreenHdl (void *pWindow)
 {
+    SolarMutexGuard aGuard;
+
     /* #i110881# workaround a gtk issue (see
        https://bugzilla.redhat.com/show_bug.cgi?id=623191#c8)
        gtk_window_fullscreen can fail due to a race condition,


More information about the Libreoffice-commits mailing list