Index: vte.c
===================================================================
RCS file: /cvs/gnome/vte/src/vte.c,v
retrieving revision 1.414
diff -u -p -u -r1.414 vte.c
--- vte.c	2 Mar 2005 08:48:59 -0000	1.414
+++ vte.c	2 Mar 2005 18:06:13 -0000
@@ -15970,26 +15970,29 @@ vte_terminal_is_processing (VteTerminal 
  * It makes sure output is never delayed by more than DISPLAY_TIMEOUT
  */
 static gboolean
+need_processing (VteTerminal *terminal)
+{
+	return _vte_buffer_length(terminal->pvt->incoming) > 0 ||
+		(terminal->pvt->pending->len > 0);
+}
+	
+static gboolean
 display_timeout (gpointer data)
 {
 	gboolean cont;
 	VteTerminal *terminal = data;
 
-	cont = vte_terminal_process_incoming (terminal);
-
-	if (!cont) {
-		remove_coalesce_timeout (terminal);
-		
-		terminal->pvt->display_timeout = VTE_INVALID_SOURCE;
-
-		return FALSE;
-	}
-	else {
+	if (need_processing (terminal) && 
+	    vte_terminal_process_incoming(terminal)) {
 		remove_coalesce_timeout (terminal);
 		add_coalesce_timeout (terminal);
+		return TRUE;
 	}
 
-	return TRUE;
+	remove_coalesce_timeout (terminal);
+	terminal->pvt->display_timeout = VTE_INVALID_SOURCE;
+	
+	return FALSE;
 }
 
 /* This function is called whenever data haven't arrived for
@@ -16001,20 +16004,15 @@ coalesce_timeout (gpointer data)
 	gboolean cont;
 	VteTerminal *terminal = data;
 
-	cont = vte_terminal_process_incoming (terminal);
-
-	if (!cont) {
-		remove_display_timeout (terminal);
-
-		terminal->pvt->coalesce_timeout = VTE_INVALID_SOURCE;
-
-		return FALSE;
-	}
-	else {
-		/* reset display timeout since we just displayed */
+	if (need_processing (terminal) &&
+	    vte_terminal_process_incoming(terminal)) {
 		remove_display_timeout (terminal);
 		add_display_timeout (terminal);
+		return TRUE;
 	}
 
-	return TRUE;
+	remove_display_timeout (terminal);
+	terminal->pvt->coalesce_timeout = VTE_INVALID_SOURCE;
+
+	return FALSE;
  }
