diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-06-17 09:23:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-06-17 09:24:20 +0100 |
commit | 6dcd81f81be0067425f42f0898316d7f52e279d6 (patch) | |
tree | 0f372d00eccbda87dba81b1daf931651036f5ecc | |
parent | ce88e6f728b1bdeb72f2721b824f786f12b9d5c4 (diff) |
Resolves: tdf#91880 Invalidate graphics when the gtk window is destroyed
not just when the GtkSalFrame is dtored
Change-Id: Iec33f4de39224f9b1e60d72c02164402196aaac0
-rw-r--r-- | vcl/inc/unx/gtk/gtkframe.hxx | 1 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalframe.cxx | 17 |
2 files changed, 12 insertions, 6 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index d46b87214e74..e56608102492 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 c67daeb7719c..624ba1a463a3 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(); } } |