diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp index 950c72e172ab0f4727c4179fe71966d267544493..8f5c0f75f1121a065d6cdf26630ec4b81fa47315 100644 --- a/src/ui/dialog/objects.cpp +++ b/src/ui/dialog/objects.cpp @@ -1757,9 +1757,10 @@ bool ObjectsPanel::on_drag_motion(const Glib::RefPtr &context, goto finally; } - context->drag_status(Gdk::ACTION_MOVE, time); - return false; } + // need to cater scenarios where we got no selection/empty bottom space + context->drag_status(Gdk::ACTION_MOVE, time); + return false; finally: // remove drop highlight @@ -1780,9 +1781,18 @@ bool ObjectsPanel::on_drag_drop(const Glib::RefPtr &context, i _tree.get_dest_row_at_pos(x, y, path, pos); if (!path) { - return true; + + if (_tree.is_blank_at_pos(x, y)){ + // We are in background/bottom empty space. Hence, need to + // drop the layer at end. + // We will move to the last node/path and set drop position accordingly + path = --_store->children().end(); + pos = Gtk::TREE_VIEW_DROP_AFTER; + } else { + return true; + } } - + auto drop_repr = getRepr(*_store->get_iter(path)); bool const drop_into = pos != Gtk::TREE_VIEW_DROP_BEFORE && // pos != Gtk::TREE_VIEW_DROP_AFTER;