From f2231db9568055a996c65285e257f1320c710a7d Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 2 Oct 2023 22:19:48 +0000 Subject: [PATCH] Use a non-abstract accessible role 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. --- src/cmd_line/viewport.rs | 2 +- src/nvim_viewport.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd_line/viewport.rs b/src/cmd_line/viewport.rs index 1b9766e9..8cdc4b7d 100644 --- a/src/cmd_line/viewport.rs +++ b/src/cmd_line/viewport.rs @@ -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); } } diff --git a/src/nvim_viewport.rs b/src/nvim_viewport.rs index c437a1b1..b333fef6 100644 --- a/src/nvim_viewport.rs +++ b/src/nvim_viewport.rs @@ -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); } }