vcl/unx/gtk3/gtkframe.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
New commits: commit b534ee2e972711af2dbaadf2190813054adda902 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Nov 22 11:33:23 2022 +0000 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Thu Nov 24 08:28:04 2022 +0100 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 <caol...@redhat.com> (cherry picked from commit 15cdee0d846854b50dd04626b73499bef9305e00) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143197 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index b17614658122..3d8cce5e02b7 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())};