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>
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index 8ae708a..8c3ad41 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -3720,7 +3720,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.x(), -pThis->m_pParent->maGeometry.y());
    {
        // 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())};