Skip to content

Commit

Permalink
Use a non-abstract accessible role
Browse files Browse the repository at this point in the history
For our viewports, we use the Widget accessible role, which is abstract.
That means that it is an overarching type representing multiple roles.
It's not very helpful to a person with vision impairment to know that
it's a general, generic widget, and because of that, GTK+ 4.12 warns
about this:

    (NeovimGtk:584029): Gtk-CRITICAL **: 21:13:28.873: gtk_widget_class_set_accessible_role: assertion '!gtk_accessible_role_is_abstract (accessible_role)' failed

To help us create a more accessible user interface and to avoid annoying
users by printing developer-specific errors to their terminal, let's
pick a more specific, non-abstract role: TextBox.
  • Loading branch information
bk2204 authored and Lyude committed Oct 5, 2023
1 parent 944747f commit f2231db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cmd_line/viewport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl ObjectSubclass for CmdlineViewportObject {

fn class_init(klass: &mut Self::Class) {
klass.set_css_name("widget");
klass.set_accessible_role(gtk::AccessibleRole::Widget);
klass.set_accessible_role(gtk::AccessibleRole::TextBox);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/nvim_viewport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl ObjectSubclass for NvimViewportObject {

fn class_init(klass: &mut Self::Class) {
klass.set_css_name("widget");
klass.set_accessible_role(gtk::AccessibleRole::Widget);
klass.set_accessible_role(gtk::AccessibleRole::TextBox);
}
}

Expand Down

0 comments on commit f2231db

Please sign in to comment.