vcl/unx/gtk3/a11y/atkwrapper.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 4ded0e7c874e8b8052a2afa55c4cdaa0b5d095b8
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Jul 13 14:32:32 2023 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Jul 14 07:40:40 2023 +0200

    gtk3 a11y: Map push button menu role to ATK equivalent
    
    at-spi2-core commit [1]
    
        commit ed16f50e4930e32c29f80552eb698baa35b4677e
        Date:   Thu Jul 21 21:49:32 2022 +0800
    
            Add `ATK_ROLE_PUSH_BUTTON_MENU`
    
    has added a `ATK_ROLE_PUSH_BUTTON_MENU` role
    (and `ATSPI_ROLE_PUSH_BUTTON_MENU` on the AT-SPI
    layer, note also pending related MR [2] to also
    increase `ATSPI_ROLE_COUNT` accordingly),
    so map LO's `BUTTON_MENU` role to that
    when using a new enough ATK version
    (available from ATK 2.46 on).
    
    [1] 
https://gitlab.gnome.org/GNOME/at-spi2-core/-/commit/ed16f50e4930e32c29f80552eb698baa35b4677e
    [2] https://gitlab.gnome.org/GNOME/at-spi2-core/-/merge_requests/146
    
    Change-Id: I9fbbc595245d212b8e79a80a1f82c363b2b402c2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154387
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/unx/gtk3/a11y/atkwrapper.cxx b/vcl/unx/gtk3/a11y/atkwrapper.cxx
index f322987dbbcd..904358a2d229 100644
--- a/vcl/unx/gtk3/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk3/a11y/atkwrapper.cxx
@@ -309,7 +309,11 @@ static AtkRole mapToAtkRole( sal_Int16 nRole )
         case accessibility::AccessibleRole::BUTTON_DROPDOWN:
             return ATK_ROLE_PUSH_BUTTON;
         case accessibility::AccessibleRole::BUTTON_MENU:
+#if ATK_CHECK_VERSION(2, 46, 0)
+            return ATK_ROLE_PUSH_BUTTON_MENU;
+#else
             return ATK_ROLE_PUSH_BUTTON;
+#endif
         case accessibility::AccessibleRole::CAPTION:
             return ATK_ROLE_CAPTION;
         case accessibility::AccessibleRole::CHART:

Reply via email to