GNOME Bugzilla – Bug 358024
Gtk+ text entry completion doesn't generate all appropriate accessibility events.
Last modified: 2018-04-15 00:08:39 UTC
Steps to reproduce: 1) Run the attached standalone application (bug_350214.py) in a terminal window. 2) Run gtk-demo, making sure GTK_MODULES=:gail:atk-bridge: is set, prior to running 3) Start the Entry Completion demo. 4) Make sure the text area in the entry completion demo has focus. 5) Type "t". A list of two available choices will appear. 6) Press the Down arrow to "select" the first "total" entry. 7) Press Return to use that to complete the entry in the text area. You will notice from the output generated by this Python script, that steps 6) and 7) do not generate any accessibility events. 8) Press F12 to terminate the Python script. See the attached file (bug_350214.out) for the output generated by running this script against the steps above. The keypress event for the Down arrow key in step 6) is at line 236. The keypress event for the Return key in step 7) is at line 238. See also Orca bug #350214: http://bugzilla.gnome.org/show_bug.cgi?id=350214 which is blocked because of this problem.
Created attachment 73515 [details] Standalone Python script to help reproduce the problem.
Created attachment 73516 [details] Output generated by bug_350214.py when following the steps to reproduce the problem.
Hi Rich: Looks like someone is going to have to poke into the internals of the text completion widget for this one (it won't be me anytime soon, because of my schedule). I would suspect that this bug will be bounced to gtk+ for at least awhile since probably some "expected" gtk+ events are not being fired (otherwise gail would be picking up on at least some kind of gtk+ signals and firing some kind of events here - at least that's what I'd expect). Some of the detailed events such as "selection-changed" are probably the responsibility of gail. What's the GTK+ widget class of the entry completion widget?
Here's the full source code of the gtk-demo Entry Completion example (from the "Source" tab in the gtk-demo app: #include <gtk/gtk.h> static GtkWidget *window = NULL; /* Creates a tree model containing the completions */ GtkTreeModel * create_completion_model (void) { GtkListStore *store; GtkTreeIter iter; store = gtk_list_store_new (1, G_TYPE_STRING); /* Append one word */ gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, 0, "GNOME", -1); /* Append another word */ gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, 0, "total", -1); /* And another word */ gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, 0, "totally", -1); return GTK_TREE_MODEL (store); } GtkWidget * do_entry_completion (GtkWidget *do_widget) { GtkWidget *vbox; GtkWidget *label; GtkWidget *entry; GtkEntryCompletion *completion; GtkTreeModel *completion_model; if (!window) { window = gtk_dialog_new_with_buttons ("GtkEntryCompletion", GTK_WINDOW (do_widget), 0, GTK_STOCK_CLOSE, GTK_RESPONSE_NONE, NULL); gtk_window_set_resizable (GTK_WINDOW (window), FALSE); g_signal_connect (window, "response", G_CALLBACK (gtk_widget_destroy), NULL); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); vbox = gtk_vbox_new (FALSE, 5); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Completion demo, try writing <b>total</b> or <b>gnome</b> for example."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); /* Create our entry */ entry = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); /* Create the completion object */ completion = gtk_entry_completion_new (); /* Assign the completion to the entry */ gtk_entry_set_completion (GTK_ENTRY (entry), completion); g_object_unref (completion); /* Create a tree model and use it as the completion model */ completion_model = create_completion_model (); gtk_entry_completion_set_model (completion, completion_model); g_object_unref (completion_model); /* Use model column 0 as the text column */ gtk_entry_completion_set_text_column (completion, 0); } if (!GTK_WIDGET_VISIBLE (window)) gtk_widget_show_all (window); else gtk_widget_destroy (window); return window; }
Offhand it looks like we need to create a GailEntryCompletion class, in a new file, gailentrycompletion.[ch]
Correction- GtkEntryCompletion is not a GtkWidget. Looks like the issue(s) are with GtkEntry. This is a regression which was introduced by the changes to GtkEntry which were introduced without corresponding modifications to the ATK support in GtkEntry (provided by GailEntry).
This problem still exists in the latest version of atk. Li, any idea on how much work is involved to fix it? Thanks.
Liyan is working on the patch.
Created attachment 107662 [details] [review] draft patch OK, here is the draft patch. Now we emit "children-changed:add" on gtkentry, and set the gtktreeview as the gtkentry's child. Also implement the ref_child and get_n_children for gtkentry, so Orca can get the childCount of the gtkentry and ref the child. Works fine on accerciser, but seems Orca doesn't now read it, is there anything need to be changed in Orca? Is Orca listening "children-changed:add" on gtkentry now?
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla. If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab: https://gitlab.gnome.org/GNOME/gtk/issues/new