mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 12:41:07 +00:00
a11y: Don't emit children-changed when nothing changed
When we have 0 columns, no children ever get added or removed.
This commit is contained in:
parent
d78971b31d
commit
113aff673f
@ -1881,11 +1881,14 @@ _gtk_tree_view_accessible_add (GtkTreeView *treeview,
|
|||||||
g_signal_emit_by_name (accessible, "row-inserted", row, n_rows);
|
g_signal_emit_by_name (accessible, "row-inserted", row, n_rows);
|
||||||
|
|
||||||
n_cols = get_n_columns (treeview);
|
n_cols = get_n_columns (treeview);
|
||||||
|
if (n_cols)
|
||||||
|
{
|
||||||
for (i = (row + 1) * n_cols; i < (row + n_rows + 1) * n_cols; i++)
|
for (i = (row + 1) * n_cols; i < (row + n_rows + 1) * n_cols; i++)
|
||||||
{
|
{
|
||||||
/* Pass NULL as the child object, i.e. 4th argument */
|
/* Pass NULL as the child object, i.e. 4th argument */
|
||||||
g_signal_emit_by_name (accessible, "children-changed::add", i, NULL, NULL);
|
g_signal_emit_by_name (accessible, "children-changed::add", i, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1920,6 +1923,8 @@ _gtk_tree_view_accessible_remove (GtkTreeView *treeview,
|
|||||||
g_signal_emit_by_name (accessible, "row-deleted", row, n_rows);
|
g_signal_emit_by_name (accessible, "row-deleted", row, n_rows);
|
||||||
|
|
||||||
n_cols = get_n_columns (treeview);
|
n_cols = get_n_columns (treeview);
|
||||||
|
if (n_cols)
|
||||||
|
{
|
||||||
for (i = (n_rows + row + 1) * n_cols - 1; i >= (row + 1) * n_cols; i--)
|
for (i = (n_rows + row + 1) * n_cols - 1; i >= (row + 1) * n_cols; i--)
|
||||||
{
|
{
|
||||||
/* Pass NULL as the child object, i.e. 4th argument */
|
/* Pass NULL as the child object, i.e. 4th argument */
|
||||||
@ -1934,6 +1939,7 @@ _gtk_tree_view_accessible_remove (GtkTreeView *treeview,
|
|||||||
(tree && _gtk_rbtree_contains (tree, cell_info->tree)))
|
(tree && _gtk_rbtree_contains (tree, cell_info->tree)))
|
||||||
g_hash_table_iter_remove (&iter);
|
g_hash_table_iter_remove (&iter);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user