diff options
author | Carl Hetherington <carl@carlh.net> | 2010-05-05 22:09:07 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-05-05 22:09:07 +0000 |
commit | 8c423ea2284289a59e1cd549e7661114fa978ec8 (patch) | |
tree | 03ab5461a4603634aa06bb798cd1a4c38af8ce8f /gtk2_ardour/editor_regions.cc | |
parent | b092cfc21638e4b89164f36ed708136c6cf9c8e0 (diff) |
Small cleanups to dragging code. Fix assertion failure on dragging a regions' parent entry from the region list to the canvas (which may be #2811). Fixes to drags of regions onto and then back off canvas; should fix #3109.
git-svn-id: svn://localhost/ardour2/branches/3.0@7068 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_regions.cc')
-rw-r--r-- | gtk2_ardour/editor_regions.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index 9d00015b8d..69890044fd 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -44,6 +44,7 @@ #include "region_view.h" #include "utils.h" #include "editor_regions.h" +#include "editor_drag.h" #include "i18n.h" @@ -1097,6 +1098,8 @@ EditorRegions::drag_data_received (const RefPtr<Gdk::DragContext>& context, vector<ustring> paths; if (data.get_target() == "GTK_TREE_MODEL_ROW") { + /* something is being dragged over the region list */ + _editor->_drags->abort (); _display.on_drag_data_received (context, x, y, data, info, time); return; } @@ -1155,12 +1158,18 @@ EditorRegions::name_edit (const Glib::ustring& path, const Glib::ustring& new_te } +/** @return Region that has been dragged out of the list, or 0 */ boost::shared_ptr<Region> EditorRegions::get_dragged_region () { list<boost::shared_ptr<Region> > regions; TreeView* source; _display.get_object_drag_data (regions, &source); + + if (regions.empty()) { + return boost::shared_ptr<Region> (); + } + assert (regions.size() == 1); return regions.front (); } |