Diff of /src/engine.c [38f5be] .. [dba5ed]  Maximize  Restore

Switch to side-by-side view

--- a/src/engine.c
+++ b/src/engine.c
@@ -298,7 +298,9 @@
   exec_t *js;
   while ((js = g_async_queue_try_pop (js_queue)))
   {
-    pthread_mutex_lock (&widgets_update_lock);
+    /* spin; play_exec gets this & the GDK lock in reverse order */ 
+    while (pthread_mutex_trylock (&widgets_update_lock))
+      sched_yield ();
     pthread_mutex_unlock (&widgets_update_lock); /* JS 'play()' needs it */
     engine_exec_obj (js->cmd, js->obj, js->cb, js->cb_data, js->ecb, js->src);
     free (js->cmd);
@@ -346,6 +348,14 @@
   if (se_startup_tag)
     g_object_set (se_startup_tag, "foreground-gdk",
 		  &widget->style->text[GTK_STATE_INSENSITIVE], NULL);
+}
+
+static void
+se_startup_insert_text_cb (GtkTextBuffer *widget, const GtkTextIter *iter,
+			   const gchar *text, gint length, gpointer data)
+{
+  if (gtk_text_iter_get_offset (iter) < se_startup_insert)
+    g_signal_stop_emission_by_name (widget, "insert-text");
 }
 
 static void
@@ -441,6 +451,7 @@
   gtk_window_set_default_size (GTK_WINDOW (se_startup_window), 400, 250);
   gtk_dialog_set_default_response (GTK_DIALOG (se_startup_window),
 				   GTK_RESPONSE_OK);
+  ui_add_undo_response (se_startup_window, NULL);
   g_object_connect (se_startup_window,
 	"signal::delete-event", G_CALLBACK (gtk_widget_hide_on_delete), NULL,
 	"signal::response", G_CALLBACK (se_startup_response_cb), NULL,
@@ -456,6 +467,8 @@
 			       w);
   g_signal_connect (se_startup_textarea, "style-set",
 		    G_CALLBACK (se_startup_tag_cb), NULL);
+  g_signal_connect (se_startup_buf, "insert-text",
+		    G_CALLBACK (se_startup_insert_text_cb), NULL);
 
   js_queue = g_async_queue_new ();
   g_async_queue_ref (js_queue);