diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 08dc3a6643..4b0fb1a741 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -312,9 +312,17 @@ bool RouteUI::disable_header_dnd () void RouteUI::on_route_drag_begin(const Glib::RefPtr& context) { + _dnd_operation_in_progress = true; handle_route_drag_begin(context); } +void +RouteUI::on_route_drag_end(const Glib::RefPtr& context) +{ + _dnd_operation_in_progress = false; + handle_route_drag_end(context); +} + void RouteUI::on_route_drag_data_get(const Glib::RefPtr& context, Gtk::SelectionData& selection_data, guint info, guint time) { diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index cab9d3fea4..9418e5198f 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -81,7 +81,8 @@ class RouteUI : public Gtk::EventBox, public WavesUI, public virtual AxisView // source callbacks void on_route_drag_begin(const Glib::RefPtr& context); void on_route_drag_data_get(const Glib::RefPtr& context, Gtk::SelectionData& selection_data, guint info, guint time); - + void on_route_drag_end(const Glib::RefPtr& context); + // destination callbacks bool on_route_drag_motion(const Glib::RefPtr& context, int x, int y, guint time); void on_route_drag_leave(const Glib::RefPtr& context, guint time); @@ -91,6 +92,8 @@ class RouteUI : public Gtk::EventBox, public WavesUI, public virtual AxisView // HANDLERS WHICH MUST BE DEFINED in inheriting class for DnD support // define in inheriting class if you want custom drag icon to be set virtual void handle_route_drag_begin(const Glib::RefPtr& context) {}; + // define in inheriting class if you want actions on dnd end + virtual void handle_route_drag_end(const Glib::RefPtr& context) {}; // define this in inheriting class to provide the responce on a draging above the widget virtual bool handle_route_drag_motion(const Glib::RefPtr& context, int x, int y, guint time) { context->drag_refuse(time); return false; }; // define this in inheriting class to provide the responce on a leaving the widget with drag @@ -258,6 +261,8 @@ class RouteUI : public Gtk::EventBox, public WavesUI, public virtual AxisView */ static PBD::Signal1 > BusSendDisplayChanged; + bool dnd_in_progress() {return _dnd_operation_in_progress; } + protected: PBD::ScopedConnectionList route_connections; bool self_destruct; @@ -314,6 +319,8 @@ class RouteUI : public Gtk::EventBox, public WavesUI, public virtual AxisView static boost::weak_ptr _showing_sends_to; static uint32_t _max_invert_buttons; + + bool _dnd_operation_in_progress; }; #endif /* __ardour_route_ui__ */