vcl/unx/gtk4/a11y.cxx |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 192bda84402bda175d7620319c019747b24de460
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu May 2 09:32:22 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri May 3 07:27:13 2024 +0200

    gtk4 a11y: Align role mapping with upstream GTK
    
    Align the gtk4 a11y role mapping with what upstream
    GTK 4 does with current git main (as of commit
    0064500146fc080dae1ef2b30bebf7bb8b35a52f), see this
    upstream GTK commit [0] and the one it refers to for
    more details:
    
        commit ad8613876c753cea8695dc8b03dcd37eb8e723a5
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Tue Apr 30 14:44:11 2024 +0200
    
            a11y atspi: Improve mapping for container roles
    
            GTK_ACCESSIBLE_ROLE_GENERIC is for
            "a nameless container that has no semantic meaning of its own",
            for which AT-SPI role ATSPI_ROLE_PANEL [1]
            ("A generic container that is often used to group
            objects.") fits better than ATSPI_ROLE_FILLER
            ("A object that fills up space in a user interface."),
            so map to this one.
    
            With this in place, widgets like GtkBox are again
            reported with the panel role on AT-SPI level after
            commit a86923de943b6a42ba431be2a336972dca9c587d
            ("a11y: Change the role for many containers"),
            whose commit message suggests that the change
            on the AT-SPI level was unintended.
    
            For GTK_ACCESSIBLE_ROLE_GROUP, use the corresponding
            ATSPI_ROLE_GROUPING ("A group of related widgets.
            This group typically has a label.").
    
            [1] https://docs.gtk.org/atspi2/enum.Role.html
    
    This causes the LO a11y roles `PANEL`, `SPLIT_PANE` and
    `ROOT_PANE` to be mapped to the AT-SPI panel role again.
    
    With the above-mentioned GTK upstream change, the native
    GTK widgets now also use the panel role without having
    to explicitly set anything on LO side rather than being
    fillers, which removes the need to set them explicitly,
    see the full commit message of
    
        commit f6ca163d3f6383d3a48dbdacc5410e630d678ea1
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Fri Apr 26 12:43:24 2024 +0200
    
            gtk4 a11y: Don't create second AT context for OOoFixed
    
    for more details.
    
    Also, map the LO `FILLER` role to `GTK_ACCESSIBLE_ROLE_WIDGET`
    which GTK maps to the AT-SPI filler role.
    (The previously used `GTK_ACCESSIBLE_ROLE_GENERIC`
    is now mapped to the AT-SPI panel role,  which
    is for widget containers rather than fillers.)
    
    [0] 
https://gitlab.gnome.org/GNOME/gtk/-/commit/ad8613876c753cea8695dc8b03dcd37eb8e723a5
    
    Change-Id: I1d1a8f626911455481d2d722790e8915daa921c7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166995
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/unx/gtk4/a11y.cxx b/vcl/unx/gtk4/a11y.cxx
index bf66b058b231..4860c7cff33d 100644
--- a/vcl/unx/gtk4/a11y.cxx
+++ b/vcl/unx/gtk4/a11y.cxx
@@ -93,10 +93,9 @@ map_accessible_role(const 
css::uno::Reference<css::accessibility::XAccessible>&
                 eRole = GTK_ACCESSIBLE_ROLE_LINK;
                 break;
             case css::accessibility::AccessibleRole::PANEL:
-                eRole = GTK_ACCESSIBLE_ROLE_GROUP;
-                break;
             case css::accessibility::AccessibleRole::ROOT_PANE:
-                eRole = GTK_ACCESSIBLE_ROLE_GROUP;
+            case css::accessibility::AccessibleRole::SPLIT_PANE:
+                eRole = GTK_ACCESSIBLE_ROLE_GENERIC;
                 break;
             case css::accessibility::AccessibleRole::MENU_BAR:
                 eRole = GTK_ACCESSIBLE_ROLE_MENU_BAR;
@@ -108,9 +107,6 @@ map_accessible_role(const 
css::uno::Reference<css::accessibility::XAccessible>&
             case css::accessibility::AccessibleRole::POPUP_MENU:
                 eRole = GTK_ACCESSIBLE_ROLE_MENU;
                 break;
-            case css::accessibility::AccessibleRole::SPLIT_PANE:
-                eRole = GTK_ACCESSIBLE_ROLE_GROUP;
-                break;
             case css::accessibility::AccessibleRole::TOOL_BAR:
                 eRole = GTK_ACCESSIBLE_ROLE_TOOLBAR;
                 break;
@@ -159,7 +155,8 @@ map_accessible_role(const 
css::uno::Reference<css::accessibility::XAccessible>&
 #endif
                 break;
             case css::accessibility::AccessibleRole::FILLER:
-                eRole = GTK_ACCESSIBLE_ROLE_GENERIC;
+                // GTK maps this to ATSPI_ROLE_FILLER
+                eRole = GTK_ACCESSIBLE_ROLE_WIDGET;
                 break;
             case css::accessibility::AccessibleRole::PUSH_BUTTON:
             case css::accessibility::AccessibleRole::BUTTON_DROPDOWN:

Reply via email to