109 lines
4.0 KiB
Diff
109 lines
4.0 KiB
Diff
From d5a1fd1bdc75c5b16e093699cfd0cf005acaba43 Mon Sep 17 00:00:00 2001
|
|
From: Daniel Micay <danielmicay@gmail.com>
|
|
Date: Sun, 21 Jun 2015 09:50:26 -0400
|
|
Subject: [PATCH] expose functions for pausing/unpausing output
|
|
|
|
---
|
|
src/vte.c | 21 +++++++++++----------
|
|
src/vteterminal.h | 4 ++++
|
|
2 files changed, 15 insertions(+), 10 deletions(-)
|
|
|
|
diff --git a/src/vte.c b/src/vte.c
|
|
index 68f7167..efa65dc 100644
|
|
--- a/src/vte.c
|
|
+++ b/src/vte.c
|
|
@@ -123,7 +123,6 @@ static char *vte_terminal_get_text_maybe_wrapped(VteTerminal *terminal,
|
|
gpointer data,
|
|
GArray *attributes,
|
|
gboolean include_trailing_spaces);
|
|
-static void _vte_terminal_disconnect_pty_read(VteTerminal *terminal);
|
|
static void _vte_terminal_disconnect_pty_write(VteTerminal *terminal);
|
|
static void vte_terminal_stop_processing (VteTerminal *terminal);
|
|
|
|
@@ -3344,9 +3343,10 @@ static void mark_input_source_invalid(VteTerminal *terminal)
|
|
_vte_debug_print (VTE_DEBUG_IO, "removed poll of vte_terminal_io_read\n");
|
|
terminal->pvt->pty_input_source = 0;
|
|
}
|
|
-static void
|
|
-_vte_terminal_connect_pty_read(VteTerminal *terminal)
|
|
+void
|
|
+vte_terminal_connect_pty_read(VteTerminal *terminal)
|
|
{
|
|
+ g_return_if_fail(VTE_IS_TERMINAL(terminal));
|
|
if (terminal->pvt->pty_channel == NULL) {
|
|
return;
|
|
}
|
|
@@ -3398,9 +3398,10 @@ _vte_terminal_connect_pty_write(VteTerminal *terminal)
|
|
}
|
|
}
|
|
|
|
-static void
|
|
-_vte_terminal_disconnect_pty_read(VteTerminal *terminal)
|
|
+void
|
|
+vte_terminal_disconnect_pty_read(VteTerminal *terminal)
|
|
{
|
|
+ g_return_if_fail(VTE_IS_TERMINAL(terminal));
|
|
if (terminal->pvt->pty_input_source != 0) {
|
|
_vte_debug_print (VTE_DEBUG_IO, "disconnecting poll of vte_terminal_io_read\n");
|
|
g_source_remove(terminal->pvt->pty_input_source);
|
|
@@ -6465,7 +6466,7 @@ vte_terminal_start_selection(VteTerminal *terminal, long x, long y,
|
|
vte_terminal_extend_selection(terminal, x, y, FALSE, TRUE);
|
|
|
|
/* Temporarily stop caring about input from the child. */
|
|
- _vte_terminal_disconnect_pty_read(terminal);
|
|
+ vte_terminal_disconnect_pty_read(terminal);
|
|
}
|
|
|
|
static gboolean
|
|
@@ -6482,7 +6483,7 @@ _vte_terminal_maybe_end_selection (VteTerminal *terminal)
|
|
terminal->pvt->selecting = FALSE;
|
|
|
|
/* Reconnect to input from the child if we paused it. */
|
|
- _vte_terminal_connect_pty_read(terminal);
|
|
+ vte_terminal_connect_pty_read(terminal);
|
|
|
|
return TRUE;
|
|
}
|
|
@@ -8631,7 +8632,7 @@ vte_terminal_finalize(GObject *object)
|
|
#endif
|
|
kill(terminal->pvt->pty_pid, SIGHUP);
|
|
}
|
|
- _vte_terminal_disconnect_pty_read(terminal);
|
|
+ vte_terminal_disconnect_pty_read(terminal);
|
|
_vte_terminal_disconnect_pty_write(terminal);
|
|
if (terminal->pvt->pty_channel != NULL) {
|
|
g_io_channel_unref (terminal->pvt->pty_channel);
|
|
@@ -12188,7 +12189,7 @@ vte_terminal_set_pty(VteTerminal *terminal,
|
|
g_object_freeze_notify(object);
|
|
|
|
if (pvt->pty != NULL) {
|
|
- _vte_terminal_disconnect_pty_read(terminal);
|
|
+ vte_terminal_disconnect_pty_read(terminal);
|
|
_vte_terminal_disconnect_pty_write(terminal);
|
|
|
|
if (terminal->pvt->pty_channel != NULL) {
|
|
@@ -12243,7 +12244,7 @@ vte_terminal_set_pty(VteTerminal *terminal,
|
|
_vte_terminal_setup_utf8 (terminal);
|
|
|
|
/* Open channels to listen for input on. */
|
|
- _vte_terminal_connect_pty_read (terminal);
|
|
+ vte_terminal_connect_pty_read (terminal);
|
|
|
|
g_object_notify(object, "pty");
|
|
|
|
diff --git a/src/vteterminal.h b/src/vteterminal.h
|
|
index b7b5277..d5d5871 100644
|
|
--- a/src/vteterminal.h
|
|
+++ b/src/vteterminal.h
|
|
@@ -170,6 +170,10 @@ void vte_terminal_paste_primary(VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
|
|
void vte_terminal_select_all(VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
|
|
void vte_terminal_unselect_all(VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
|
|
|
|
+/* pause and unpause output */
|
|
+void vte_terminal_disconnect_pty_read(VteTerminal *vte);
|
|
+void vte_terminal_connect_pty_read(VteTerminal *vte);
|
|
+
|
|
/* By-word selection */
|
|
void vte_terminal_set_word_char_exceptions(VteTerminal *terminal,
|
|
const char *exceptions) _VTE_GNUC_NONNULL(1);
|