[vte] api: Don't process a reset when input is disabled



commit 8c70f85361ddc54a61086929210add51dfc44da7
Author: Christian Persch <chpe gnome org>
Date:   Mon May 16 10:25:29 2016 +0200

    api: Don't process a reset when input is disabled
    
    With input disabled, only allow a reset when it comes from
    the terminal, not via the API.

 src/vte.cc         |    6 +++++-
 src/vtegtk.cc      |    2 +-
 src/vteinternal.hh |    3 ++-
 3 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 04ce345..14a9f7e 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -10213,8 +10213,12 @@ VteTerminalPrivate::set_mouse_autohide(bool autohide)
  */
 void
 VteTerminalPrivate::reset(bool clear_tabstops,
-                          bool clear_history)
+                          bool clear_history,
+                          bool from_api)
 {
+        if (from_api && !m_input_enabled)
+                return;
+
         GObject *object = G_OBJECT(m_terminal);
         g_object_freeze_notify(object);
 
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index 7371f76..de01a60 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -2501,7 +2501,7 @@ vte_terminal_reset(VteTerminal *terminal,
                    gboolean clear_history)
 {
        g_return_if_fail(VTE_IS_TERMINAL(terminal));
-        IMPL(terminal)->reset(clear_tabstops, clear_history);
+        IMPL(terminal)->reset(clear_tabstops, clear_history, true);
 }
 
 /**
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 0e3c323..7292c33 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -793,7 +793,8 @@ public:
                         GError **error);
 
         void reset(bool clear_tabstops,
-                   bool clear_history);
+                   bool clear_history,
+                   bool from_api = false);
 
         void feed(char const* data,
                   gssize length);


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