diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-11-22 11:33:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-11-22 17:47:25 +0100 |
commit | 15cdee0d846854b50dd04626b73499bef9305e00 (patch) | |
tree | 4ef31b132afe5e9861e0548ed25e07a52e43b9c8 /vcl/unx | |
parent | fc3993c6794e2749400755ecd032165a61d5d959 (diff) |
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>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk3/gtkframe.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index 8ae708ad99b5..8c3ad41e930a 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())}; |