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 a86923de94
("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 commit is contained in:
Michael Weghorn
2024-04-30 14:44:11 +02:00
parent abfd94d2d9
commit ad8613876c

View File

@@ -97,7 +97,7 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
return ATSPI_ROLE_FORM;
case GTK_ACCESSIBLE_ROLE_GENERIC:
return ATSPI_ROLE_FILLER;
return ATSPI_ROLE_PANEL;
case GTK_ACCESSIBLE_ROLE_GRID:
return ATSPI_ROLE_TABLE;
@@ -106,7 +106,7 @@ gtk_accessible_role_to_atspi_role (GtkAccessibleRole role)
return ATSPI_ROLE_TABLE_CELL;
case GTK_ACCESSIBLE_ROLE_GROUP:
return ATSPI_ROLE_PANEL;
return ATSPI_ROLE_GROUPING;
case GTK_ACCESSIBLE_ROLE_HEADING:
return ATSPI_ROLE_HEADING;