[Libreoffice-commits] core.git: vcl/unx

Maxim Monastirsky momonasmon at gmail.com
Wed Jun 13 21:52:43 UTC 2018


 vcl/unx/gtk3/gtk3gtkframe.cxx |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

New commits:
commit 2bfc4cefc21ab18e9ff7cc5fdc743bcc856d103c
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Wed Jun 13 01:28:37 2018 +0300

    Correctly mirror autofilter in rtl ui, tdf#117175 related
    
    Change-Id: I9b4e13bd0c95b5cba76a04dadaa70087bbed8e9c
    Reviewed-on: https://gerrit.libreoffice.org/55773
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>
    Tested-by: Maxim Monastirsky <momonasmon at gmail.com>

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);


More information about the Libreoffice-commits mailing list