diff --git a/gtk2_ardour/region_editor.cc b/gtk2_ardour/region_editor.cc index 5e8e712587..5184f8e143 100644 --- a/gtk2_ardour/region_editor.cc +++ b/gtk2_ardour/region_editor.cc @@ -514,7 +514,7 @@ drag_targets () RegionEditor::RegionFxBox::RegionFxBox (std::shared_ptr r) : _region (r) - , _display (drop_targets ()) + , _display (drop_targets (), Gdk::ACTION_COPY | Gdk::ACTION_MOVE) , _no_redisplay (false) , _placement (-1) { @@ -535,6 +535,7 @@ RegionEditor::RegionFxBox::RegionFxBox (std::shared_ptr r) _display.Reordered.connect (sigc::mem_fun (*this, &RegionFxBox::reordered)); _display.DropFromAnotherBox.connect (sigc::mem_fun (*this, &RegionFxBox::object_drop)); _display.DropFromExternal.connect (sigc::mem_fun (*this, &RegionFxBox::plugin_drop)); + _display.DragRefuse.connect (sigc::mem_fun (*this, &RegionFxBox::drag_refuse)); _display.signal_key_press_event ().connect (sigc::mem_fun (*this, &RegionFxBox::on_key_press), false); @@ -892,6 +893,13 @@ RegionEditor::RegionFxBox::delete_dragged_plugins (Region::RegionFxList const& f redisplay_plugins (); } +bool +RegionEditor::RegionFxBox::drag_refuse (Gtkmm2ext::DnDVBox* source, RegionFxEntry*) +{ + RegionFxBox* other = reinterpret_cast (source->get_data ("regionfxbox")); + return (other && other->_region == _region); +} + void RegionEditor::RegionFxBox::object_drop (Gtkmm2ext::DnDVBox* source, RegionFxEntry* pos, Glib::RefPtr const& context) { diff --git a/gtk2_ardour/region_editor.h b/gtk2_ardour/region_editor.h index e235343928..3f3dc86687 100644 --- a/gtk2_ardour/region_editor.h +++ b/gtk2_ardour/region_editor.h @@ -124,6 +124,7 @@ private: void plugin_drop (Gtk::SelectionData const&, RegionFxEntry*, Glib::RefPtr const&); void object_drop (Gtkmm2ext::DnDVBox*, RegionFxEntry*, Glib::RefPtr const&); void delete_dragged_plugins (std::list> const&); + bool drag_refuse (Gtkmm2ext::DnDVBox*, RegionFxEntry*); std::shared_ptr find_drop_position (RegionFxEntry*);