[gnome-color-manager/gnome-3-2] Ensure the VTE is flushed when the spawned program exits



commit eb904a5bd7fd2cc20ca27a032a9b4bf4ad6dffe5
Author: Richard Hughes <richard hughsie com>
Date:   Fri Feb 24 16:56:22 2012 +0000

    Ensure the VTE is flushed when the spawned program exits
    
    This means we can catch the error that is set at exit time from Argyllcms.

 src/gcm-calibrate-argyll.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/src/gcm-calibrate-argyll.c b/src/gcm-calibrate-argyll.c
index 9572d99..9771adc 100644
--- a/src/gcm-calibrate-argyll.c
+++ b/src/gcm-calibrate-argyll.c
@@ -2061,6 +2061,9 @@ out:
 }
 
 #ifdef HAVE_VTE
+
+static void gcm_calibrate_argyll_flush_vte (GcmCalibrateArgyll *calibrate_argyll);
+
 /**
  * gcm_calibrate_argyll_exit_cb:
  **/
@@ -2070,6 +2073,9 @@ gcm_calibrate_argyll_exit_cb (VteTerminal *terminal, GcmCalibrateArgyll *calibra
 	gint exit_status;
 	GcmCalibrateArgyllPrivate *priv = calibrate_argyll->priv;
 
+	/* flush the VTE output */
+	gcm_calibrate_argyll_flush_vte (calibrate_argyll);
+
 	/* get the child exit status */
 	exit_status = vte_terminal_get_child_exit_status (terminal);
 	g_debug ("child exit-status is %i", exit_status);
@@ -2540,10 +2546,10 @@ gcm_calibrate_argyll_selection_func_cb (VteTerminal *terminal, glong column, glo
 }
 
 /**
- * gcm_calibrate_argyll_cursor_moved_cb:
+ * gcm_calibrate_argyll_flush_vte:
  **/
 static void
-gcm_calibrate_argyll_cursor_moved_cb (VteTerminal *terminal, GcmCalibrateArgyll *calibrate_argyll)
+gcm_calibrate_argyll_flush_vte (GcmCalibrateArgyll *calibrate_argyll)
 {
 	gchar *output;
 	gchar **split;
@@ -2552,6 +2558,7 @@ gcm_calibrate_argyll_cursor_moved_cb (VteTerminal *terminal, GcmCalibrateArgyll
 	glong col;
 	gboolean ret;
 	GcmCalibrateArgyllPrivate *priv = calibrate_argyll->priv;
+	VteTerminal *terminal = VTE_TERMINAL (priv->terminal);
 
 	/* select the text we've got since last time */
 	vte_terminal_get_cursor_position (terminal, &col, &row);
@@ -2579,6 +2586,17 @@ gcm_calibrate_argyll_cursor_moved_cb (VteTerminal *terminal, GcmCalibrateArgyll
 	g_free (output);
 	g_strfreev (split);
 }
+
+/**
+ * gcm_calibrate_argyll_cursor_moved_cb:
+ **/
+static void
+gcm_calibrate_argyll_cursor_moved_cb (VteTerminal *terminal,
+				      GcmCalibrateArgyll *calibrate_argyll)
+{
+	gcm_calibrate_argyll_flush_vte (calibrate_argyll);
+}
+
 #endif
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]