a11y: Improve child index helpers
We need to use gtk_accessible_should_present() whenever we calculate accessible tree positions, to avoid inconsistencies. While we are at it, make these helpers usable for finding the position of accesibles that are now ignored, by not looking at should_present for the object itself. This will be relevant when we calculate the position of objects whose HIDDEN state changes.
This commit is contained in:
@@ -347,12 +347,12 @@ get_index_in_parent (GtkWidget *widget)
|
||||
child;
|
||||
child = gtk_widget_get_next_sibling (child))
|
||||
{
|
||||
if (!gtk_accessible_should_present (GTK_ACCESSIBLE (child)))
|
||||
continue;
|
||||
|
||||
if (child == widget)
|
||||
return idx;
|
||||
|
||||
if (!gtk_accessible_should_present (GTK_ACCESSIBLE (child)))
|
||||
continue;
|
||||
|
||||
idx++;
|
||||
}
|
||||
|
||||
@@ -374,12 +374,12 @@ get_index_in_toplevels (GtkWidget *widget)
|
||||
|
||||
g_object_unref (window);
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
continue;
|
||||
|
||||
if (window == widget)
|
||||
return idx;
|
||||
|
||||
if (!gtk_accessible_should_present (GTK_ACCESSIBLE (window)))
|
||||
continue;
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user