Resolves: tdf#152155 use gtk's knowledge of relative widget positions
rather than effectively emulate it poorly
Change-Id: If1c215892645d83937d97158a2d3f8ddac10364e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143104
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 15cdee0d846854b50dd04626b73499bef9305e00)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143197
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index b176146..3d8cce5 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -3688,7 +3688,12 @@ void GtkSalFrame::signalRealize(GtkWidget*, gpointer frame)
tools::Rectangle aFloatRect = FloatingWindow::ImplConvertToAbsPos(pVclParent, pThis->m_aFloatRect);
if (gdk_window_get_window_type(widget_get_surface(pThis->m_pParent->m_pWindow)) != GDK_WINDOW_TOPLEVEL)
aFloatRect.Move(-pThis->m_pParent->maGeometry.nX, -pThis->m_pParent->maGeometry.nY);
{
// See tdf#152155 for an example
gtk_coord nX(0), nY(0.0);
gtk_widget_translate_coordinates(pThis->m_pParent->m_pWindow, widget_get_toplevel(pThis->m_pParent->m_pWindow), 0, 0, &nX, &nY);
aFloatRect.Move(nX, nY);
}
GdkRectangle rect {static_cast<int>(aFloatRect.Left()), static_cast<int>(aFloatRect.Top()),
static_cast<int>(aFloatRect.GetWidth()), static_cast<int>(aFloatRect.GetHeight())};