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



commit 0d9b6a3bffd8902a7a81bca3e79fa5d8b8febb2a
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 2639e93..3f04aa1 100644
--- a/src/gcm-calibrate-argyll.c
+++ b/src/gcm-calibrate-argyll.c
@@ -1886,6 +1886,9 @@ out:
 }
 
 #ifdef HAVE_VTE
+
+static void gcm_calibrate_argyll_flush_vte (GcmCalibrateArgyll *calibrate_argyll);
+
 /**
  * gcm_calibrate_argyll_exit_cb:
  **/
@@ -1895,6 +1898,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);
@@ -2340,10 +2346,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;
@@ -2352,6 +2358,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);
@@ -2379,6 +2386,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]