diff --git a/docs/reference/gtk/section-accessibility.md b/docs/reference/gtk/section-accessibility.md index 51839fcda0..51ff858c2f 100644 --- a/docs/reference/gtk/section-accessibility.md +++ b/docs/reference/gtk/section-accessibility.md @@ -46,6 +46,7 @@ Each role name is part of the #GtkAccessibleRole enumeration. | Role name | Description | Related GTK widget | |-----------|-------------|--------------------| +| `APPLICATION` | An application window | [class@Gtk.Window] | | `BUTTON` | A control that performs an action when pressed | [class@Gtk.Button], [class@Gtk.LinkButton], [class@Gtk.Expander] | | `CHECKBOX` | A control that has three possible value: `true`, `false`, or `undefined` | [class@Gtk.CheckButton] | | `COMBOBOX` | A control that can be expanded to show a list of possible values to select | [class@Gtk.ComboBox] | @@ -78,7 +79,6 @@ Each role name is part of the #GtkAccessibleRole enumeration. | `TAB_PANEL` | A page in a notebook or stack | [class@Gtk.Stack] | | `TEXT_BOX` | A type of input that allows free-form text as its value. | [class@Gtk.Entry], [class@Gtk.PasswordEntry], [class@Gtk.TextView] | | `TREE_GRID` | A treeview-like columned list | [class@Gtk.ColumnView] | -| `WINDOW` | An application window | [class@Gtk.Window] | | `...` | … | See the [WAI-ARIA](https://www.w3.org/WAI/PF/aria/appendices#quickref) list diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c index d5e974a6ee..2594c8eca6 100644 --- a/gtk/a11y/gtkatspicontext.c +++ b/gtk/a11y/gtkatspicontext.c @@ -144,7 +144,7 @@ collect_states (GtkAtSpiContext *self, set_atspi_state (&states, ATSPI_STATE_VISIBLE); set_atspi_state (&states, ATSPI_STATE_SHOWING); - if (ctx->accessible_role == GTK_ACCESSIBLE_ROLE_WINDOW) + if (ctx->accessible_role == GTK_ACCESSIBLE_ROLE_APPLICATION) { if (gtk_accessible_get_platform_state (accessible, GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE)) set_atspi_state (&states, ATSPI_STATE_ACTIVE); @@ -1170,7 +1170,7 @@ gtk_at_spi_context_platform_change (GtkATContext *ctx, /* Orca tracks the window:activate and window:deactivate events on top * levels to decide whether to track other AT-SPI events */ - if (gtk_accessible_get_accessible_role (accessible) == GTK_ACCESSIBLE_ROLE_WINDOW) + if (gtk_accessible_get_accessible_role (accessible) == GTK_ACCESSIBLE_ROLE_APPLICATION) { if (state) emit_window_event (self, "activate"); diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index a4084a0442..a0607988f6 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -148,7 +148,9 @@ * * # Accessibility * - * `GtkWindow` uses the %GTK_ACCESSIBLE_ROLE_WINDOW role. + * Until GTK 4.10, `GtkWindow` used the `GTK_ACCESSIBLE_ROLE_WINDOW` role. + * + * Since GTK 4.12, `GtkWindow` uses the `GTK_ACCESSIBLE_ROLE_APPLICATION` role. * * # Actions * @@ -1222,7 +1224,7 @@ gtk_window_class_init (GtkWindowClass *klass) gtk_widget_class_set_css_name (widget_class, I_("window")); - gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_WINDOW); + gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_APPLICATION); } /** diff --git a/testsuite/a11y/window.c b/testsuite/a11y/window.c index 50e9b78b25..8894f36060 100644 --- a/testsuite/a11y/window.c +++ b/testsuite/a11y/window.c @@ -5,7 +5,7 @@ window_role (void) { GtkWidget *window = gtk_window_new (); - gtk_test_accessible_assert_role (window, GTK_ACCESSIBLE_ROLE_WINDOW); + gtk_test_accessible_assert_role (window, GTK_ACCESSIBLE_ROLE_APPLICATION); gtk_window_destroy (GTK_WINDOW (window)); }