[gedit] Fix problem when switching a tab in a not active tab group.



commit 1b096900b333b01b9efbc7b0651b0896f879310e
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Thu Jun 10 00:50:02 2010 +0200

    Fix problem when switching a tab in a not active tab group.
    
    This avoids handling the switch_page signal when setting the tab
    and setting the focus.

 gedit/gedit-multi-notebook.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-multi-notebook.c b/gedit/gedit-multi-notebook.c
index d500ad0..4e18ee7 100644
--- a/gedit/gedit-multi-notebook.c
+++ b/gedit/gedit-multi-notebook.c
@@ -318,6 +318,12 @@ notebook_switch_page (GtkNotebook        *book,
 {
 	GeditTab *tab;
 
+	/* When we switch a tab from a notebook that it is not the active one
+	   the switch page is emitted before the set focus, so we do this check
+	   and we avoid to call switch page twice */
+	if (GTK_WIDGET (book) != mnb->priv->active_notebook)
+		return;
+
 	/* CHECK: I don't know why but it seems notebook_switch_page is called
 	two times every time the user change the active tab */
 	tab = GEDIT_TAB (gtk_notebook_get_nth_page (book, page_num));



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