Index: gail/gailtextview.c
===================================================================
--- gail/gailtextview.c	(revision 15334)
+++ gail/gailtextview.c	(working copy)
@@ -166,6 +166,7 @@
 static gint             get_selection_bound            (GtkTextBuffer    *buffer);
 static void             emit_text_caret_moved          (GailTextView     *gail_text_view,
                                                         gint             insert_offset);
+static gint             insert_handler                 (gpointer         data);
 static gint             insert_idle_handler            (gpointer         data);
 
 static GailWidgetClass *parent_class = NULL;
@@ -1465,7 +1466,7 @@
           g_source_remove (gail_text_view->insert_notify_handler);
         }
       gail_text_view->insert_notify_handler = 0;
-      insert_idle_handler (gail_text_view);
+      insert_handler (gail_text_view);
       gail_text_view->position = position;
       gail_text_view->length = length;
     }
@@ -1510,7 +1511,7 @@
           return;
         }
 
-      insert_idle_handler (gail_text_view);
+      insert_handler (gail_text_view);
     }
   g_signal_emit_by_name (accessible, "text_changed::delete",
                          offset, length);
@@ -1658,7 +1659,7 @@
     {
       g_source_remove (gail_text_view->insert_notify_handler);
       gail_text_view->insert_notify_handler = 0;
-      insert_idle_handler (gail_text_view);
+      insert_handler (gail_text_view);
     }
 
   if (insert_offset != gail_text_view->previous_insert_offset)
@@ -1674,14 +1675,23 @@
     }
 }
 
-static gint
+static gint 
 insert_idle_handler (gpointer data)
 {
+  /* On the idle we're out the main lock */
+  GDK_THREADS_ENTER();
+
+  insert_handler(data);
+
+  GDK_THREADS_LEAVE();
+}
+
+static gint
+insert_handler (gpointer data)
+{
   GailTextView *gail_text_view;
   GtkTextBuffer *buffer;
 
-  GDK_THREADS_ENTER ();
-
   gail_text_view = GAIL_TEXT_VIEW (data);
 
   g_signal_emit_by_name (data,
@@ -1703,8 +1713,6 @@
       gail_text_view->previous_selection_bound = get_selection_bound (buffer);
     }
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
