Bug 611514 - Layers inside layer groups can't be dragged to layer dock buttons

In the drop callbacks, don't check if the GimpContainerView's container
contains the dropped item, it might be in a sub-container. Instead,
simply checking if the GimpContainerView knows the item is sufficient
(and also much simpler than a recursive container serach).
This commit is contained in:
Michael Natterer 2010-03-02 17:54:29 +01:00
parent 9c4864e789
commit 842f1df2f2
2 changed files with 5 additions and 10 deletions

View File

@ -1185,11 +1185,9 @@ gimp_container_view_button_viewable_dropped (GtkWidget *widget,
GimpViewable *viewable,
gpointer data)
{
GimpContainerView *view = GIMP_CONTAINER_VIEW (data);
GimpContainerViewPrivate *private = GIMP_CONTAINER_VIEW_GET_PRIVATE (view);
GimpContainerView *view = GIMP_CONTAINER_VIEW (data);
if (viewable && private->container &&
gimp_container_have (private->container, GIMP_OBJECT (viewable)))
if (viewable && gimp_container_view_lookup (view, viewable))
{
gimp_container_view_item_selected (view, viewable);

View File

@ -1134,13 +1134,10 @@ gimp_item_tree_view_new_dropped (GtkWidget *widget,
gpointer data)
{
GimpItemTreeViewClass *item_view_class = GIMP_ITEM_TREE_VIEW_GET_CLASS (data);
GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (data);
GimpContainer *container;
GimpContainerView *view = GIMP_CONTAINER_VIEW (data);
container = gimp_container_view_get_container (GIMP_CONTAINER_VIEW (view));
if (viewable && gimp_container_have (container, GIMP_OBJECT (viewable)) &&
item_view_class->new_default_action)
if (item_view_class->new_default_action &&
viewable && gimp_container_view_lookup (view, viewable))
{
GtkAction *action;