[gtk+] notebook: Don't crash when dnd'ing tabs out



commit 3281d1a284fc870488de7da7de756e27d227d367
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jan 18 15:01:49 2016 +0100

    notebook: Don't crash when dnd'ing tabs out
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760754

 gtk/gtknotebook.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index fd85d89..8481d45 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -3060,9 +3060,18 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook)
 
           priv->has_scrolled = FALSE;
           priv->during_reorder = FALSE;
-        }
 
-      hide_drag_window (notebook, priv, page);
+          hide_drag_window (notebook, priv, page);
+        }
+      else
+        {
+          g_object_ref (page->tab_label);
+          gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (page->tab_label)), page->tab_label);
+          gtk_css_node_set_parent (gtk_widget_get_css_node (page->tab_label),
+                                   gtk_css_gadget_get_node (page->gadget));
+          gtk_widget_set_parent (page->tab_label, GTK_WIDGET (notebook));
+          g_object_unref (page->tab_label);
+        }
 
       priv->operation = DRAG_OPERATION_NONE;
 


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