a11y: Only emit name-changed once
authorJoanmarie Diggs <jdiggs@igalia.com>
Wed, 25 Mar 2015 03:01:48 +0000 (04:01 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 25 Mar 2015 03:06:23 +0000 (04:06 +0100)
We were emitting it twice, once with deleting the old text, once with
inserting the new text.

https://bugzilla.gnome.org/show_bug.cgi?id=746706

gtk/a11y/gtktextcellaccessible.c

index 30a2121f85a44decf8d0f4f8d169dcb2227b0ea0..aca96933246b76bc2b06faa83ddb7f8c5fca5501 100644 (file)
@@ -158,8 +158,6 @@ gtk_text_cell_accessible_update_cache (GtkCellAccessible *cell)
         {
           g_signal_emit_by_name (cell, "text-changed::delete",
                                  0, text_cell->priv->cell_length);
-          if (obj->name == NULL)
-            g_object_notify (G_OBJECT (obj), "accessible-name");
         }
 
       g_free (text_cell->priv->cell_text);
@@ -170,10 +168,10 @@ gtk_text_cell_accessible_update_cache (GtkCellAccessible *cell)
         {
           g_signal_emit_by_name (cell, "text-changed::insert",
                                  0, text_cell->priv->cell_length);
-
-          if (obj->name == NULL)
-            g_object_notify (G_OBJECT (obj), "accessible-name");
         }
+
+      if (obj->name == NULL)
+        g_object_notify (G_OBJECT (obj), "accessible-name");
     }
 
   g_free (text);