Kaydet (Commit) 133e04fc authored tarafından Caolán McNamara's avatar Caolán McNamara

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 6dcd81f8)
üst 2b13db01
......@@ -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 );
......
......@@ -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();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment