don't try to reorder dockables in a dock containing exactly one dockable

2003-03-24  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpdock.c (gimp_dock_separator_drag_drop): don't
	try to reorder dockables in a dock containing exactly one dockable
	(fixes bug #109042)
This commit is contained in:
Michael Natterer
2003-03-24 18:01:52 +00:00
committed by Michael Natterer
parent c40a6f9920
commit d48936b95a
2 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2003-03-24 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdock.c (gimp_dock_separator_drag_drop): don't
try to reorder dockables in a dock containing exactly one dockable
(fixes bug #109042)
2003-03-24 Michael Natterer <mitch@gimp.org> 2003-03-24 Michael Natterer <mitch@gimp.org>
* app/paint/paint-enums.[ch]: register GimpPaintApplicationMode * app/paint/paint-enums.[ch]: register GimpPaintApplicationMode

View File

@ -565,6 +565,25 @@ gimp_dock_separator_drag_drop (GtkWidget *widget,
else if (index == 2) else if (index == 2)
index = -1; index = -1;
/* if dropping to the same dock, take care that we don't try
* to reorder the *only* dockable in the dock
*/
if (src_dockable->dockbook->dock == dock)
{
gint n_books;
gint n_dockables;
n_books = g_list_length (dock->dockbooks);
children =
gtk_container_get_children (GTK_CONTAINER (src_dockable->dockbook));
n_dockables = g_list_length (children);
g_list_free (children);
if (n_books == 1 && n_dockables == 1)
return TRUE; /* successfully do nothing */
}
g_object_ref (src_dockable); g_object_ref (src_dockable);
gimp_dockbook_remove (src_dockable->dockbook, src_dockable); gimp_dockbook_remove (src_dockable->dockbook, src_dockable);