Index: a11y/object.c
===================================================================
--- a11y/object.c	(revision 8767)
+++ a11y/object.c	(working copy)
@@ -303,6 +303,19 @@ gtk_html_a11y_get_focus_object (GtkWidge
 	return obj;
 }
 
+static AtkObject * gtk_html_a11y_focus_object = NULL;
+
+static void
+manage_focus_object_change (const char *func_name, AtkObject *fo, AtkObject *obj, GtkWidget *widget)
+{
+	printf("%s:new_fo:%p, my_fo:%p, obj:%p, gail_fo_before_notify:%p: focus_set:%d\n", func_name, fo, gtk_html_a11y_focus_object, obj, g_object_get_data (G_OBJECT(obj), "gail-focus-object"), GTK_WIDGET_HAS_FOCUS (widget)?1:0);
+	atk_focus_tracker_notify (fo);
+	printf("\tgail after atk_..._notify:%p\n",g_object_get_data (G_OBJECT(obj), "gail-focus-object"));
+	g_object_set_data (G_OBJECT(obj), "gail-focus-object", fo);
+	printf("\tgail after set_data:%p\n",g_object_get_data (G_OBJECT(obj), "gail-focus-object"));
+	gtk_html_a11y_focus_object = fo;
+}
+
 static void
 gtk_html_a11y_grab_focus_cb(GtkWidget * widget)
 {
@@ -314,18 +327,16 @@ gtk_html_a11y_grab_focus_cb(GtkWidget * 
 		return;
 
 	obj = gtk_widget_get_accessible (widget);
-	g_object_set_data (G_OBJECT(obj), "gail-focus-object", focus_object);
+	/*gtk_html_a11y_focus_object = focus_object;*/
 
 	clue = html_utils_get_accessible(GTK_HTML(widget)->engine->clue, obj);
 	atk_object_set_parent(clue, obj);
 
-	atk_focus_tracker_notify (focus_object);
+	/*atk_focus_tracker_notify (focus_object);*/
+	manage_focus_object_change (__FUNCTION__,focus_object,obj,widget);
 
 }
 
-
-static AtkObject * gtk_html_a11y_focus_object = NULL;
-
 static void
 gtk_html_a11y_cursor_changed_cb (GtkWidget *widget)
 {
@@ -336,9 +347,9 @@ gtk_html_a11y_cursor_changed_cb (GtkWidg
 	obj = gtk_widget_get_accessible (widget);
 
 	if (gtk_html_a11y_focus_object != focus_object) {
-		gtk_html_a11y_focus_object = focus_object;
-        	g_object_set_data (G_OBJECT(obj), "gail-focus-object", focus_object);
-        	atk_focus_tracker_notify (focus_object);
+		/*gtk_html_a11y_focus_object = focus_object;
+        	atk_focus_tracker_notify (focus_object);*/
+		manage_focus_object_change (__FUNCTION__,focus_object,obj,widget);
 	} else {
 		if (G_IS_HTML_A11Y_TEXT(focus_object)) {
 			gint offset;
@@ -363,9 +374,9 @@ gtk_html_a11y_insert_object_cb (GtkWidge
 	g_return_if_fail (a11y != NULL);
 
 	if (gtk_html_a11y_focus_object != a11y) {
-		gtk_html_a11y_focus_object = a11y;
-        	g_object_set_data (G_OBJECT(obj), "gail-focus-object", a11y);
-        	atk_focus_tracker_notify (a11y);
+		/*gtk_html_a11y_focus_object = a11y;
+        	atk_focus_tracker_notify (a11y);*/
+		manage_focus_object_change (__FUNCTION__,a11y,obj,widget);
 	}
 
 	if (G_IS_HTML_A11Y_TEXT(a11y)) {
@@ -378,21 +389,20 @@ static void
 gtk_html_a11y_delete_object_cb (GtkWidget * widget, int pos, int len)
 {
 	AtkObject * a11y, *obj;
-	HTMLCursor *cursor = GTK_HTML (widget)->engine->cursor;
 
         obj = gtk_widget_get_accessible (widget);
 	a11y = gtk_html_a11y_get_focus_object (widget);
 	g_return_if_fail (a11y != NULL);
 
 	if (gtk_html_a11y_focus_object != a11y) {
-		gtk_html_a11y_focus_object = a11y;
-        	g_object_set_data (G_OBJECT(obj), "gail-focus-object", a11y);
-        	atk_focus_tracker_notify (a11y);
+		/*gtk_html_a11y_focus_object = a11y;
+        	atk_focus_tracker_notify (a11y);*/
+		manage_focus_object_change (__FUNCTION__,a11y,obj,widget);
 	}
 
 	if (G_IS_HTML_A11Y_TEXT(a11y)) {
 		g_signal_emit_by_name (a11y, "text_changed::delete", pos, len);
-		printf ("the cur is %d\n", cursor->offset);
+		/*printf ("the cur is %d\n", cursor->offset);*/
 	}
 }
 
@@ -431,8 +441,9 @@ gtk_html_a11y_new (GtkWidget *widget)
 	focus_object = gtk_html_a11y_get_focus_object (widget);
 
 	if (focus_object && gtk_html_a11y_focus_object != focus_object) {
-		gtk_html_a11y_focus_object = focus_object;
-		g_object_set_data (G_OBJECT (accessible), "gail-focus-object", focus_object);
+		/*gtk_html_a11y_focus_object = focus_object;
+		atk_focus_tracker_notify (focus_object);*/
+		manage_focus_object_change (__FUNCTION__,focus_object,gtk_widget_get_accessible (widget),widget);
 	}
 
 	return accessible;
