vcl/unx/gtk3/gtk3gtkframe.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
New commits: commit ce16f1f32937ee881268abf91454900b0170c637 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Feb 14 16:57:12 2020 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Feb 14 20:57:06 2020 +0100 Resolves: tdf#130414 don't crash attempting gtk_fixed_move if parent changed Change-Id: I5b51f1fb0eccbdb1b3ad14ff7b36077a0016a838 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88738 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 62d49dd106e8..118c77f9f7b3 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -709,10 +709,15 @@ void GtkSalFrame::moveWindow( long nX, long nY ) { if( isChild( false ) ) { - if( m_pParent ) - gtk_fixed_move( m_pParent->getFixedContainer(), + GtkWidget* pParent = m_pParent ? gtk_widget_get_parent(m_pWindow) : nullptr; + // tdf#130414 its possible that we were reparented and are no longer inside + // our original GtkFixed parent + if (pParent && GTK_IS_FIXED(pParent)) + { + gtk_fixed_move( GTK_FIXED(pParent), m_pWindow, nX - m_pParent->maGeometry.nX, nY - m_pParent->maGeometry.nY ); + } } else gtk_window_move( GTK_WINDOW(m_pWindow), nX, nY ); @@ -1030,7 +1035,6 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle ) // insert into container gtk_fixed_put( m_pParent->getFixedContainer(), m_pWindow, 0, 0 ); - } } else _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits