[gtk+] GtkNotebook: fix crash when DnD tabs between windows



commit eeb9de80e17d1915d877c98eabd9a9a1f4423e9c
Author: Xan Lopez <xan igalia com>
Date:   Fri Dec 30 21:09:21 2011 +0100

    GtkNotebook: fix crash when DnD tabs between windows
    
    When doing DnD between windows the tab label is set as the child of
    the DnD info window. If this is happening the remove method of
    GtkNotebook should not unparent the tab label, since it's been already
    unparented, belongs to the DnD window and will be properly destroyed
    when the DnD is over.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=639875

 gtk/gtknotebook.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 32cdee7..231893f 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -4958,7 +4958,10 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
   gtk_widget_unparent (page->child);
 
   tab_label = page->tab_label;
-  if (tab_label)
+  /* Do not unparent the tab label if it's already in another
+     hierarchy. It means we are in the middle of a DnD and it's
+     already taken care of. */
+  if (tab_label && NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page))
     {
       g_object_ref (tab_label);
       gtk_notebook_remove_tab_label (notebook, page);



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