[Xfce4-commits] [apps/xfce4-terminal] 01/01: Update 'Read-Only' checkbox state when switching between tabs

noreply at xfce.org noreply at xfce.org
Tue Jul 18 04:24:26 CEST 2017


This is an automated email from the git hooks/post-receive script.

f   2   4   0   4       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-terminal.

commit ed14b777d4984faa83c1109255d2d558f3c6d0e8
Author: Igor <f2404 at yandex.ru>
Date:   Mon Jul 17 22:24:18 2017 -0400

    Update 'Read-Only' checkbox state when switching between tabs
---
 terminal/terminal-screen.c |  9 +++++++++
 terminal/terminal-screen.h |  1 +
 terminal/terminal-window.c | 14 +++++++++++---
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index c5c2eb4..2c67732 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -2445,6 +2445,15 @@ terminal_screen_update_font (TerminalScreen *screen)
 
 
 
+gboolean
+terminal_screen_get_input_enabled (TerminalScreen *screen)
+{
+  terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
+  return vte_terminal_get_input_enabled (VTE_TERMINAL (screen->terminal));
+}
+
+
+
 void
 terminal_screen_set_input_enabled (TerminalScreen *screen,
                                    gboolean        enabled)
diff --git a/terminal/terminal-screen.h b/terminal/terminal-screen.h
index 2cafce1..adad985 100644
--- a/terminal/terminal-screen.h
+++ b/terminal/terminal-screen.h
@@ -113,6 +113,7 @@ void            terminal_screen_update_scrolling_bar      (TerminalScreen *scree
 
 void            terminal_screen_update_font               (TerminalScreen *screen);
 
+gboolean        terminal_screen_get_input_enabled         (TerminalScreen *screen);
 void            terminal_screen_set_input_enabled         (TerminalScreen *screen,
                                                            gboolean        enabled);
 
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index eb59a10..10f8ddf 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -895,6 +895,11 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       gtk_action_set_sensitive (window->priv->action_search_next, can_search);
       gtk_action_set_sensitive (window->priv->action_search_prev, can_search);
 
+      /* update read-only mode */
+      action = terminal_window_get_action (window, "read-only");
+      gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
+                                    !terminal_screen_get_input_enabled (window->priv->active));
+
       /* update the "Go" menu */
       action = g_object_get_qdata (G_OBJECT (window->priv->active), tabs_menu_action_quark);
       if (G_LIKELY (action != NULL))
@@ -1756,10 +1761,13 @@ terminal_window_action_readonly (GtkToggleAction *action,
 
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   input_enabled = !gtk_toggle_action_get_active (action);
-  gtk_action_set_sensitive (terminal_window_get_action (window, "reset"), input_enabled);
-  gtk_action_set_sensitive (terminal_window_get_action (window, "reset-and-clear"), input_enabled);
+  if (terminal_screen_get_input_enabled (window->priv->active) != input_enabled)
+    {
+      gtk_action_set_sensitive (terminal_window_get_action (window, "reset"), input_enabled);
+      gtk_action_set_sensitive (terminal_window_get_action (window, "reset-and-clear"), input_enabled);
+      terminal_screen_set_input_enabled (window->priv->active, input_enabled);
+    }
 G_GNUC_END_IGNORE_DEPRECATIONS
-  terminal_screen_set_input_enabled (window->priv->active, input_enabled);
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list