forked from AuroraMiddleware/gtk
GtkNotebook: Maintain invariants during tab dnd
It turns out that we can end up removing a notebook child while the tab is still 'detached'. Child removal causes gtk_notebook_remove_tab_label() to be called on the tab label, but that function did not deal with the eventuality that the tab label may be a child of the dnd window. http://bugzilla.gnome.org/show_bug.cgi?id=677943
This commit is contained in:
parent
b7c498b9bd
commit
325cf071d1
@ -3150,11 +3150,8 @@ hide_drag_window (GtkNotebook *notebook,
|
||||
{
|
||||
g_object_ref (page->tab_label);
|
||||
|
||||
if (GTK_IS_WINDOW (parent))
|
||||
{
|
||||
/* parent widget is the drag window */
|
||||
gtk_container_remove (GTK_CONTAINER (parent), page->tab_label);
|
||||
}
|
||||
if (GTK_IS_WINDOW (parent)) /* parent widget is the drag window */
|
||||
gtk_container_remove (GTK_CONTAINER (parent), page->tab_label);
|
||||
else
|
||||
gtk_widget_unparent (page->tab_label);
|
||||
|
||||
@ -4932,7 +4929,17 @@ gtk_notebook_remove_tab_label (GtkNotebook *notebook,
|
||||
page->mnemonic_activate_signal = 0;
|
||||
|
||||
gtk_widget_set_state_flags (page->tab_label, 0, TRUE);
|
||||
gtk_widget_unparent (page->tab_label);
|
||||
if (gtk_widget_get_window (page->tab_label) != gtk_widget_get_window (GTK_WIDGET (notebook)) ||
|
||||
!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page))
|
||||
{
|
||||
GtkWidget *parent;
|
||||
|
||||
parent = gtk_widget_get_parent (page->tab_label);
|
||||
if (GTK_IS_WINDOW (parent))
|
||||
gtk_container_remove (GTK_CONTAINER (parent), page->tab_label);
|
||||
else
|
||||
gtk_widget_unparent (page->tab_label);
|
||||
}
|
||||
page->tab_label = NULL;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user