From b3b28e82b51153c61b51fe632639f333c8c6b1e0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 29 Jan 2012 22:51:36 +0000 Subject: Slightly hacky-fix for misbehaviour when drag-and-dropping processors onto the blank entry (#4668). git-svn-id: svn://localhost/ardour2/branches/3.0@11385 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/processor_box.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gtk2_ardour/processor_box.cc') diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index d6697f9de7..9ee94c1793 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -769,6 +769,21 @@ ProcessorBox::object_drop(DnDVBox* source, ProcessorEntry* posit boost::shared_ptr p; if (position) { p = position->processor (); + if (!p) { + /* dropped on the blank entry (which will be before the + fader), so use the first non-blank child as our + `dropped on' processor */ + list c = processor_display.children (); + list::iterator i = c.begin (); + while (dynamic_cast (*i)) { + assert (i != c.end ()); + ++i; + } + + assert (i != c.end ()); + p = (*i)->processor (); + assert (p); + } } list children = source->selection (); -- cgit v1.2.3