mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 11:20:12 +00:00
notebook: Do not reorder tabs after a grab notify if there isn't an ongoing reorder operation
This broke in f535251507
that removed
during_reorder in favor of using the current operation, but removed the
check from gtk_notebook_stop_reorder().
This commit is contained in:
parent
cc88153130
commit
feabf35371
@ -3013,24 +3013,27 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook)
|
||||
|
||||
if (page->reorderable || page->detachable)
|
||||
{
|
||||
gint old_page_num, page_num, i;
|
||||
GList *element;
|
||||
|
||||
element = get_drop_position (notebook);
|
||||
old_page_num = g_list_position (priv->children, priv->focus_tab);
|
||||
page_num = reorder_tab (notebook, element, priv->focus_tab);
|
||||
gtk_notebook_child_reordered (notebook, page);
|
||||
|
||||
if (priv->has_scrolled || old_page_num != page_num)
|
||||
if (priv->operation == DRAG_OPERATION_REORDER)
|
||||
{
|
||||
for (element = priv->children, i = 0; element; element = element->next, i++)
|
||||
gint old_page_num, page_num, i;
|
||||
GList *element;
|
||||
|
||||
element = get_drop_position (notebook);
|
||||
old_page_num = g_list_position (priv->children, priv->focus_tab);
|
||||
page_num = reorder_tab (notebook, element, priv->focus_tab);
|
||||
gtk_notebook_child_reordered (notebook, page);
|
||||
|
||||
if (priv->has_scrolled || old_page_num != page_num)
|
||||
{
|
||||
if (MIN (old_page_num, page_num) <= i && i <= MAX (old_page_num, page_num))
|
||||
gtk_widget_child_notify (((GtkNotebookPage *) element->data)->child, "position");
|
||||
for (element = priv->children, i = 0; element; element = element->next, i++)
|
||||
{
|
||||
if (MIN (old_page_num, page_num) <= i && i <= MAX (old_page_num, page_num))
|
||||
gtk_widget_child_notify (((GtkNotebookPage *) element->data)->child, "position");
|
||||
}
|
||||
g_signal_emit (notebook,
|
||||
notebook_signals[PAGE_REORDERED], 0,
|
||||
page->child, page_num);
|
||||
}
|
||||
g_signal_emit (notebook,
|
||||
notebook_signals[PAGE_REORDERED], 0,
|
||||
page->child, page_num);
|
||||
}
|
||||
|
||||
priv->has_scrolled = FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user