summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2018-06-13 01:28:37 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2018-06-13 23:52:20 +0200
commit2bfc4cefc21ab18e9ff7cc5fdc743bcc856d103c (patch)
tree62b8bddd08ebbe16d3664aee4a31047a908c45ad
parent23fa8a6ed05386ce6e9997747b416279f46ddd5f (diff)
Correctly mirror autofilter in rtl ui, tdf#117175 related
Change-Id: I9b4e13bd0c95b5cba76a04dadaa70087bbed8e9c Reviewed-on: https://gerrit.libreoffice.org/55773 Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx20
1 files changed, 8 insertions, 12 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index da4457640ff4..69f02adc7473 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -3052,23 +3052,19 @@ void GtkSalFrame::signalRealize(GtkWidget*, gpointer frame)
rect_anchor = GDK_GRAVITY_NORTH_EAST;
}
- GdkRectangle rect {static_cast<int>(pThis->m_aFloatRect.Left()),
- static_cast<int>(pThis->m_aFloatRect.Top()),
- static_cast<int>(pThis->m_aFloatRect.GetWidth()),
- static_cast<int>(pThis->m_aFloatRect.GetHeight())};
-
- if (AllSettings::GetLayoutRTL())
+ VclPtr<vcl::Window> pVclParent = pThis->GetWindow()->GetParent();
+ if (pVclParent->HasMirroredGraphics() && pVclParent->IsRTLEnabled())
{
- rect.x = pThis->m_pParent->maGeometry.nWidth-rect.width-1-rect.x;
swapDirection(rect_anchor);
swapDirection(menu_anchor);
}
- if (gdk_window_get_window_type(widget_get_window(pThis->m_pParent->m_pWindow)) == GDK_WINDOW_TOPLEVEL)
- {
- rect.x += pThis->m_pParent->maGeometry.nX;
- rect.y += pThis->m_pParent->maGeometry.nY;
- }
+ tools::Rectangle aFloatRect = FloatingWindow::ImplConvertToAbsPos(pVclParent, pThis->m_aFloatRect);
+ if (pThis->m_pParent->m_pParent)
+ aFloatRect.Move(-pThis->m_pParent->maGeometry.nX, -pThis->m_pParent->maGeometry.nY);
+
+ GdkRectangle rect {static_cast<int>(aFloatRect.Left()), static_cast<int>(aFloatRect.Top()),
+ static_cast<int>(aFloatRect.GetWidth()), static_cast<int>(aFloatRect.GetHeight())};
GdkWindow* gdkWindow = widget_get_window(pThis->m_pWindow);
gdk_window_move_to_rect(gdkWindow, &rect, rect_anchor, menu_anchor, GDK_ANCHOR_FLIP, 0, 0);