[evolution/wip/webkit2] Bug 765636 - Runtime warning from spi_register_deregister_object() on quit



commit 06a8f7421bdb47dd97469f363f84becab266feae
Author: Milan Crha <mcrha redhat com>
Date:   Thu Apr 28 12:50:42 2016 +0200

    Bug 765636 - Runtime warning from spi_register_deregister_object() on quit

 e-util/gal-a11y-e-table-item.c |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)
---
diff --git a/e-util/gal-a11y-e-table-item.c b/e-util/gal-a11y-e-table-item.c
index 84dbf1c..c94b2cb 100644
--- a/e-util/gal-a11y-e-table-item.c
+++ b/e-util/gal-a11y-e-table-item.c
@@ -120,8 +120,8 @@ item_finalized (gpointer user_data,
        }
        g_object_set_data (G_OBJECT (a11y), "gail-focus-object", NULL);
 
-       atk_state_set_add_state (priv->state_set, ATK_STATE_DEFUNCT);
-       atk_object_notify_state_change (ATK_OBJECT (a11y), ATK_STATE_DEFUNCT, TRUE);
+       if (atk_state_set_add_state (priv->state_set, ATK_STATE_DEFUNCT))
+               atk_object_notify_state_change (ATK_OBJECT (a11y), ATK_STATE_DEFUNCT, TRUE);
 
        if (priv->selection)
                gal_a11y_e_table_item_unref_selection (a11y);
@@ -129,6 +129,28 @@ item_finalized (gpointer user_data,
        g_object_unref (a11y);
 }
 
+static void
+gal_a11y_e_table_item_state_change_cb (AtkObject *atkobject,
+                                      const gchar *state_name,
+                                      gboolean was_set,
+                                      gpointer user_data)
+{
+       g_return_if_fail (GAL_A11Y_IS_E_TABLE_ITEM (atkobject));
+
+       if (atk_state_type_for_name (state_name) == ATK_STATE_DEFUNCT) {
+               GalA11yETableItemPrivate *priv;
+
+               priv = GET_PRIVATE (atkobject);
+
+               g_return_if_fail (priv != NULL);
+
+               if (was_set)
+                       atk_state_set_add_state (priv->state_set, ATK_STATE_DEFUNCT);
+               else
+                       atk_state_set_remove_state (priv->state_set, ATK_STATE_DEFUNCT);
+       }
+}
+
 static AtkStateSet *
 eti_ref_state_set (AtkObject *accessible)
 {
@@ -1139,6 +1161,8 @@ gal_a11y_e_table_item_new (ETableItem *item)
        atk_state_set_add_state (GET_PRIVATE (a11y)->state_set, ATK_STATE_SHOWING);
        atk_state_set_add_state (GET_PRIVATE (a11y)->state_set, ATK_STATE_VISIBLE);
 
+       g_signal_connect (a11y, "state-change", G_CALLBACK (gal_a11y_e_table_item_state_change_cb), NULL);
+
        accessible = ATK_OBJECT (a11y);
 
        GET_PRIVATE (a11y)->item = item;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]