Get the good notebook with tab to a new window

error encountered :

assertion 'gtk_widget_get_parent (widget) == GTK_WIDGET (container)
...' failed

When moving tab to a new window and having several notebooks,
make sure the source notebook is the good one
( wich is not always the active one )