[Xfce4-commits] [apps/xfce4-terminal] 01/01: Do not un-close tab that was detached to create another window

noreply at xfce.org noreply at xfce.org
Wed Aug 10 14:17:09 CEST 2016


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

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit e127a502110f55e3c95be3a91ca85db24dbc02c1
Author: Igor <f2404 at yandex.ru>
Date:   Wed Aug 10 15:17:03 2016 +0300

    Do not un-close tab that was detached to create another window
---
 terminal/terminal-window.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 62fbafb..6603692 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -963,7 +963,7 @@ terminal_window_notebook_page_removed (GtkNotebook    *notebook,
     }
 
   /* store info on the tab being closed */
-  tab_info = g_malloc (sizeof (TerminalWindowTabInfo));
+  tab_info = g_new (TerminalWindowTabInfo, 1);
   tab_info->position = page_num;
   tab_info->working_directory = g_strdup (terminal_screen_get_working_directory (TERMINAL_SCREEN (child)));
   window->closed_tabs_list = g_list_append (window->closed_tabs_list, tab_info);
@@ -1238,6 +1238,7 @@ terminal_window_notebook_create_window (GtkNotebook    *notebook,
                                         TerminalWindow *window)
 {
   TerminalScreen *screen;
+  GList          *link;
 
   terminal_return_val_if_fail (TERMINAL_IS_WINDOW (window), NULL);
   terminal_return_val_if_fail (TERMINAL_IS_SCREEN (child), NULL);
@@ -1264,6 +1265,14 @@ terminal_window_notebook_create_window (GtkNotebook    *notebook,
 
       /* release our reference */
       g_object_unref (G_OBJECT (screen));
+
+      /* erase last closed tabs entry as we don't want it on detach */
+      link = g_list_last (window->closed_tabs_list);
+      window->closed_tabs_list = g_list_remove_link (window->closed_tabs_list, link);
+      terminal_window_tab_info_free (link->data);
+      g_list_free (link);
+      /* and update action to make the undo action inactive */
+      terminal_window_update_actions (window);
     }
 
   return NULL;

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


More information about the Xfce4-commits mailing list