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:56 +0100 |
commit | 133e04fc1a870c0aad207e82eefeeeceaba5dc6d (patch) | |
tree | 26ba4079cd23db9a9274b2d28e15a32fc59a4689 | |
parent | 2b13db0125dabdfa77f8b5d0e8ef934b65a4f17d (diff) |
Resolves: tdf#91880 Invalidate graphics when the gtk window is destroyed
not just when the GtkSalFrame is dtored
Change-Id: Iec33f4de39224f9b1e60d72c02164402196aaac0
(cherry picked from commit 6dcd81f81be0067425f42f0898316d7f52e279d6)
-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 5792efa8a025..9268eb0e6b16 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 5ed6465b250e..e687d2b9a45a 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 ); @@ -1317,8 +1323,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", (gpointer)LIBO_VERSION_DOTTED); @@ -3071,11 +3079,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) ); @@ -4005,6 +4009,7 @@ void GtkSalFrame::signalDestroy( GtkWidget* pObj, gpointer frame ) { pThis->m_pFixedContainer = NULL; pThis->m_pWindow = NULL; + pThis->InvalidateGraphics(); } } |