[vte/vte-0-44] api: Don't process a reset when input is disabled



commit 2057abd188b57b988ab6165058b77b46e3e4af84
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.
    
    (cherry picked from commit 8c70f85361ddc54a61086929210add51dfc44da7)

 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 316ab13..efad1f7 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 98ff6e0..6ea47f9 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -2511,7 +2511,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 696750b..1ef0cea 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -795,7 +795,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]