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

Caolán McNamara caolanm at redhat.com
Wed Jun 17 01:24:43 PDT 2015


 vcl/inc/unx/gtk/gtkframe.hxx       |    1 +
 vcl/unx/gtk/window/gtksalframe.cxx |   17 +++++++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 6dcd81f81be0067425f42f0898316d7f52e279d6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 17 09:23:32 2015 +0100

    Resolves: tdf#91880 Invalidate graphics when the gtk window is destroyed
    
    not just when the GtkSalFrame is dtored
    
    Change-Id: Iec33f4de39224f9b1e60d72c02164402196aaac0

diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index d46b872..e566081 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -231,6 +231,7 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider
     void Init( SalFrame* pParent, sal_uLong nStyle );
     void Init( SystemParentData* pSysData );
     void InitCommon();
+    void InvalidateGraphics();
 
     // signals
     static gboolean     signalButton( GtkWidget*, GdkEventButton*, gpointer );
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index c67daeb..624ba1a 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -845,17 +845,23 @@ void GtkSalFrame::EnsureAppMenuWatch()
 #endif
 }
 
-GtkSalFrame::~GtkSalFrame()
+void GtkSalFrame::InvalidateGraphics()
 {
-    for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); ++i )
+    for (unsigned int i = 0; i < SAL_N_ELEMENTS(m_aGraphics); ++i)
     {
         if( !m_aGraphics[i].pGraphics )
             continue;
 #if !GTK_CHECK_VERSION(3,0,0)
         m_aGraphics[i].pGraphics->SetDrawable( None, m_nXScreen );
+        m_aGraphics[i].pGraphics->SetWindow(NULL);
 #endif
         m_aGraphics[i].bInUse = false;
     }
+}
+
+GtkSalFrame::~GtkSalFrame()
+{
+    InvalidateGraphics();
 
     if( m_pParent )
         m_pParent->m_aChildren.remove( this );
@@ -1316,8 +1322,10 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle )
         }
     }
     else
+    {
         m_pWindow = gtk_widget_new( GTK_TYPE_WINDOW, "type", eWinType,
                                     "visible", FALSE, NULL );
+    }
     g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", this );
     g_object_set_data( G_OBJECT( m_pWindow ), "libo-version", const_cast<char *>(LIBO_VERSION_DOTTED));
 
@@ -3070,11 +3078,7 @@ void GtkSalFrame::createNewWindow( ::Window aNewParent, bool bXEmbed, SalX11Scre
     }
     if( m_pRegion )
     {
-#if GTK_CHECK_VERSION(3,0,0)
-        cairo_region_destroy( m_pRegion );
-#else
         gdk_region_destroy( m_pRegion );
-#endif
     }
     if( m_pFixedContainer )
         gtk_widget_destroy( GTK_WIDGET(m_pFixedContainer) );
@@ -4004,6 +4008,7 @@ void GtkSalFrame::signalDestroy( GtkWidget* pObj, gpointer frame )
     {
         pThis->m_pFixedContainer = NULL;
         pThis->m_pWindow = NULL;
+        pThis->InvalidateGraphics();
     }
 }
 


More information about the Libreoffice-commits mailing list