[Xfce4-commits] [apps/xfce4-terminal] 01/01: Proper handling of switching to another tab after the current one gets closed

noreply at xfce.org noreply at xfce.org
Fri Jun 17 16:16:11 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 2f35b1b950e197fb9e3bbb0fb5e897ba02e4c15f
Author: Igor <f2404 at yandex.ru>
Date:   Fri Jun 17 17:15:25 2016 +0300

    Proper handling of switching to another tab after the current one gets closed
    
    Fixes #10691
---
 terminal/terminal-window.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 82e298c..983d679 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -788,6 +788,7 @@ terminal_window_notebook_page_switched (GtkNotebook     *notebook,
 
   /* get the new active page */
   active = TERMINAL_SCREEN (page);
+
   terminal_return_if_fail (window == NULL);
   terminal_return_if_fail (active == NULL || TERMINAL_IS_SCREEN (active));
 
@@ -896,7 +897,9 @@ terminal_window_notebook_page_removed (GtkNotebook    *notebook,
                                        guint           page_num,
                                        TerminalWindow *window)
 {
-  gint npages;
+  GtkWidget *new_page;
+  gint       new_page_num;
+  gint       npages;
 
   terminal_return_if_fail (TERMINAL_IS_SCREEN (child));
   terminal_return_if_fail (TERMINAL_IS_WINDOW (window));
@@ -920,15 +923,19 @@ terminal_window_notebook_page_removed (GtkNotebook    *notebook,
     {
       /* no tabs, destroy the window */
       gtk_widget_destroy (GTK_WIDGET (window));
+      return;
     }
-  else
-    {
-      /* show the tabs when needed */
-      terminal_window_notebook_show_tabs (window);
 
-      /* regenerate the "Go" menu */
-      terminal_window_rebuild_tabs_menu (window);
-    }
+  /* send a signal about switching to another tab */
+  new_page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (window->notebook));
+  new_page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (window->notebook), new_page_num);
+  terminal_window_notebook_page_switched (notebook, new_page, new_page_num, window);
+
+  /* show the tabs when needed */
+  terminal_window_notebook_show_tabs (window);
+
+  /* regenerate the "Go" menu */
+  terminal_window_rebuild_tabs_menu (window);
 }
 
 static gboolean

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


More information about the Xfce4-commits mailing list