[gedit] Do not update the visibility if there is no tabs.



commit 2dc437f216ac3f35e8a9c7d6e457d6e7a9648f5a
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Jun 2 19:04:41 2010 +0200

    Do not update the visibility if there is no tabs.

 gedit/gedit-notebook.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gedit/gedit-notebook.c b/gedit/gedit-notebook.c
index 5e7a055..976e423 100644
--- a/gedit/gedit-notebook.c
+++ b/gedit/gedit-notebook.c
@@ -896,12 +896,17 @@ remove_tab (GeditTab      *tab,
 	    GeditNotebook *nb)
 {
 	gint position;
+	gint num_pages;
 
 	position = gtk_notebook_page_num (GTK_NOTEBOOK (nb), GTK_WIDGET (tab));
 
 	remove_tab_label (nb, tab);
+	num_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb));
 	gtk_notebook_remove_page (GTK_NOTEBOOK (nb), position);
-	update_tabs_visibility (nb, FALSE);
+
+	/* If there is no tabs, calling this is pointless */
+	if (--num_pages > 0)
+		update_tabs_visibility (nb, FALSE);
 }
 
 /**



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