[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - vcl/unx

Caolán McNamara caolanm at redhat.com
Thu Nov 9 14:03:56 UTC 2017


 vcl/unx/gtk3/gtk3gtkframe.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 49c7359e8510fe640d4a8d78036036995c6d7e96
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Nov 3 15:53:22 2017 +0000

    gtk3: fix popover placement in RTL
    
    Change-Id: I8c20b277ce943f915941b2af9353f98c66f9065c
    Reviewed-on: https://gerrit.libreoffice.org/44272
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 5c34d4f940bc..9ac51974ea88 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2482,7 +2482,7 @@ bool GtkSalFrame::ShowTooltip(const OUString& rHelpText, const tools::Rectangle&
 #if GTK_CHECK_VERSION(3,12,0)
 namespace
 {
-    void set_pointing_to(GtkPopover *pPopOver, const tools::Rectangle& rHelpArea)
+    void set_pointing_to(GtkPopover *pPopOver, const tools::Rectangle& rHelpArea, const SalFrameGeometry& rGeometry)
     {
         GdkRectangle aRect;
         aRect.x = rHelpArea.Left();
@@ -2503,6 +2503,9 @@ namespace
                 break;
         }
 
+        if (AllSettings::GetLayoutRTL())
+            aRect.x = rGeometry.nWidth-aRect.width-1-aRect.x;
+
         gtk_popover_set_pointing_to(pPopOver, &aRect);
     }
 }
@@ -2525,7 +2528,7 @@ sal_uIntPtr GtkSalFrame::ShowPopover(const OUString& rHelpText, const tools::Rec
     else if (nFlags & QuickHelpFlags::Right)
         gtk_popover_set_position(GTK_POPOVER(pWidget), GTK_POS_LEFT);
 
-    set_pointing_to(GTK_POPOVER(pWidget), rHelpArea);
+    set_pointing_to(GTK_POPOVER(pWidget), rHelpArea, maGeometry);
 
     gtk_popover_set_modal(GTK_POPOVER(pWidget), false);
 
@@ -2545,7 +2548,7 @@ bool GtkSalFrame::UpdatePopover(sal_uIntPtr nId, const OUString& rHelpText, cons
 #if GTK_CHECK_VERSION(3,12,0)
     GtkWidget *pWidget = reinterpret_cast<GtkWidget*>(nId);
 
-    set_pointing_to(GTK_POPOVER(pWidget), rHelpArea);
+    set_pointing_to(GTK_POPOVER(pWidget), rHelpArea, maGeometry);
 
     GtkWidget *pLabel = gtk_bin_get_child(GTK_BIN(pWidget));
     OString sUTF = OUStringToOString(rHelpText, RTL_TEXTENCODING_UTF8);


More information about the Libreoffice-commits mailing list