This is a workaround for atspi-atk behaviour.
atspi-atk uses signal emission hooks. So it to already catches
signal emissions on creation of objects, before anyone could even
think of g_signal_connect()ing.
https://bugzilla.gnome.org/show_bug.cgi?id=746706
}
static void
-gtk_boolean_cell_accessible_update_cache (GtkCellAccessible *cell)
+gtk_boolean_cell_accessible_update_cache (GtkCellAccessible *cell,
+ gboolean emit_signal)
{
GtkBooleanCellAccessible *boolean_cell = GTK_BOOLEAN_CELL_ACCESSIBLE (cell);
gboolean active;
{
boolean_cell->priv->cell_value = !boolean_cell->priv->cell_value;
- atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_CHECKED, active);
+ if (emit_signal)
+ atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_CHECKED, active);
}
if (boolean_cell->priv->cell_sensitive != sensitive)
{
boolean_cell->priv->cell_sensitive = !boolean_cell->priv->cell_sensitive;
- atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_SENSITIVE, sensitive);
+ if (emit_signal)
+ atk_object_notify_state_change (ATK_OBJECT (cell), ATK_STATE_SENSITIVE, sensitive);
}
}
/*
* gtk_cell_accessible_update_cache:
* @cell: the cell that is changed
+ * @emit_signal: whether or not to notify the ATK bridge
*
* Notifies the cell that the values in the data in the row that
* is used to feed the cell renderer with has changed. The
* cell_changed function of @cell is called to send update
* notifications for the properties it takes from its cell
- * renderer.
+ * renderer. If @emit_signal is TRUE, also notify the ATK bridge
+ * of the change. The bridge should be notified when an existing
+ * cell changes; not when a newly-created cell is being set up.
*
* Note that there is no higher granularity available about which
* properties changed, so you will need to make do with this
* function.
**/
void
-_gtk_cell_accessible_update_cache (GtkCellAccessible *cell)
+_gtk_cell_accessible_update_cache (GtkCellAccessible *cell,
+ gboolean emit_signal)
{
GtkCellAccessibleClass *klass;
klass = GTK_CELL_ACCESSIBLE_GET_CLASS (cell);
if (klass->update_cache)
- klass->update_cache (cell);
+ klass->update_cache (cell, emit_signal);
}
struct _GtkCellAccessibleClass
{
GtkAccessibleClass parent_class;
- void (*update_cache) (GtkCellAccessible *cell);
+ void (*update_cache) (GtkCellAccessible *cell,
+ gboolean emit_signal);
};
GDK_AVAILABLE_IN_ALL
void _gtk_cell_accessible_state_changed (GtkCellAccessible *cell,
GtkCellRendererState added,
GtkCellRendererState removed);
-void _gtk_cell_accessible_update_cache (GtkCellAccessible *cell);
+void _gtk_cell_accessible_update_cache (GtkCellAccessible *cell,
+ gboolean emit_signal);
void _gtk_cell_accessible_initialize (GtkCellAccessible *cell,
GtkWidget *widget,
AtkObject *parent);
}
static void
-gtk_container_cell_accessible_update_cache (GtkCellAccessible *cell)
+gtk_container_cell_accessible_update_cache (GtkCellAccessible *cell,
+ gboolean emit_signal)
{
GtkContainerCellAccessible *container = GTK_CONTAINER_CELL_ACCESSIBLE (cell);
GList *l;
for (l = container->priv->children; l; l = l->next)
- _gtk_cell_accessible_update_cache (l->data);
+ _gtk_cell_accessible_update_cache (l->data, emit_signal);
}
static void
/* Misc */
-static void gtk_text_cell_accessible_update_cache (GtkCellAccessible *cell);
+static void gtk_text_cell_accessible_update_cache (GtkCellAccessible *cell,
+ gboolean emit_signal);
static void atk_text_interface_init (AtkTextIface *iface);
}
static void
-gtk_text_cell_accessible_update_cache (GtkCellAccessible *cell)
+gtk_text_cell_accessible_update_cache (GtkCellAccessible *cell,
+ gboolean emit_signal)
{
GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (cell);
AtkObject *obj = ATK_OBJECT (cell);
if (g_strcmp0 (text_cell->priv->cell_text, text) != 0)
{
- if (text_cell->priv->cell_length)
+ if (text_cell->priv->cell_length && emit_signal)
{
g_signal_emit_by_name (cell, "text-changed::delete",
0, text_cell->priv->cell_length);
text_cell->priv->cell_text = g_strdup (text);
text_cell->priv->cell_length = text_length;
- if (text_length)
+ if (text_length && emit_signal)
{
g_signal_emit_by_name (cell, "text-changed::insert",
0, text_cell->priv->cell_length);
}
- if (obj->name == NULL)
+ if (obj->name == NULL && emit_signal)
g_object_notify (G_OBJECT (obj), "accessible-name");
}
cell_info_new (accessible, tree, node, column, cell);
set_cell_data (treeview, accessible, cell);
- _gtk_cell_accessible_update_cache (cell);
+ _gtk_cell_accessible_update_cache (cell, FALSE);
return cell;
}
continue;
set_cell_data (treeview, accessible, cell);
- _gtk_cell_accessible_update_cache (cell);
+ _gtk_cell_accessible_update_cache (cell, TRUE);
}
g_signal_emit_by_name (accessible, "visible-data-changed");