[gedit] Fix crash on Move to Tab Group.



commit a12a3816ed122c7ca92ecf2a851828ad3156d703
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Nov 2 13:14:19 2013 +0100

    Fix crash on Move to Tab Group.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711278

 gedit/gedit-multi-notebook.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-multi-notebook.c b/gedit/gedit-multi-notebook.c
index b8922e5..1db661b 100644
--- a/gedit/gedit-multi-notebook.c
+++ b/gedit/gedit-multi-notebook.c
@@ -862,10 +862,22 @@ gedit_multi_notebook_add_new_notebook_with_tab (GeditMultiNotebook *mnb,
 
        g_return_if_fail (page_num != -1);
 
+       /* When gtk_notebook_insert_page is called the focus is set in
+          the notebook, we don't want this to happen until the page is added.
+          Also we don't want to call switch_page when we add the tab
+          but when we switch the notebook. */
+       g_signal_handlers_block_by_func (l->data, notebook_set_focus, mnb);
+       g_signal_handlers_block_by_func (l->data, notebook_switch_page, mnb);
+
        gedit_notebook_move_tab (GEDIT_NOTEBOOK (l->data),
                                 GEDIT_NOTEBOOK (notebook),
                                 tab,
                                 -1);
+
+       g_signal_handlers_unblock_by_func (l->data, notebook_switch_page, mnb);
+       g_signal_handlers_unblock_by_func (l->data, notebook_set_focus, mnb);
+
+       notebook_set_focus (GTK_CONTAINER (notebook), NULL, mnb);
 }
 
 void


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