vcl/unx/gtk3/gtk3gtkinst.cxx |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 976367d5d0d0eb2099df32ca4b562a202da6d405
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Jul 11 18:54:51 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat Jul 11 21:08:46 2020 +0200

    use accessible description before querying help
    
    Change-Id: I1b5814566fd0750b92797cbf8581da0bee003630
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98568
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index d1503f4cae44..ebcb51236fed 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -15176,9 +15176,18 @@ public:
                                          gboolean /*keyboard_mode*/, 
GtkTooltip *tooltip)
     {
         const ImplSVHelpData& aHelpData = ImplGetSVHelpData();
-        if (aHelpData.mbBalloonHelp)
+        if (aHelpData.mbBalloonHelp) // extended tips
         {
-            /*Current mechanism which needs help installed*/
+            // by default use accessible description
+            AtkObject* pAtkObject = gtk_widget_get_accessible(pWidget);
+            const char* pDesc = pAtkObject ? 
atk_object_get_description(pAtkObject) : nullptr;
+            if (pDesc && pDesc[0])
+            {
+                gtk_tooltip_set_text(tooltip, pDesc);
+                return true;
+            }
+
+            // fallback to the mechanism which needs help installed
             OString sHelpId = ::get_help_id(pWidget);
             Help* pHelp = !sHelpId.isEmpty() ? Application::GetHelp() : 
nullptr;
             if (pHelp)
@@ -15190,15 +15199,6 @@ public:
                     return true;
                 }
             }
-
-            /*This is how I would prefer things to be, only a few like this 
though*/
-            AtkObject* pAtkObject = gtk_widget_get_accessible(pWidget);
-            const char* pDesc = pAtkObject ? 
atk_object_get_description(pAtkObject) : nullptr;
-            if (pDesc && pDesc[0])
-            {
-                gtk_tooltip_set_text(tooltip, pDesc);
-                return true;
-            }
         }
 
         const char* pDesc = gtk_widget_get_tooltip_text(pWidget);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to