summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-11-24 00:46:51 +0000
committerCarl Hetherington <carl@carlh.net>2010-11-24 00:46:51 +0000
commitd40e61c91490896663d264995fb042d9698441f7 (patch)
treea2c11e7ba111fdc8c7689eab45401494a8ec212e /gtk2_ardour
parent0ee9f216d52fb8d98324b9348ed9425be99f1e14 (diff)
Fix crash on failed processor DnD. Fixes #3554.
git-svn-id: svn://localhost/ardour2/branches/3.0@8079 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/processor_box.cc52
-rw-r--r--gtk2_ardour/processor_box.h1
2 files changed, 32 insertions, 21 deletions
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index 0109a36cea..c4849c9fc3 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -1064,32 +1064,42 @@ ProcessorBox::compute_processor_sort_keys ()
}
if (_route->reorder_processors (our_processors)) {
+ /* Reorder failed, so report this to the user. As far as I can see this must be done
+ in an idle handler: it seems that the redisplay_processors() that happens below destroys
+ widgets that were involved in the drag-and-drop on the processor list, which causes problems
+ when the drag is torn down after this handler function is finished.
+ */
+ Glib::signal_idle().connect_once (sigc::mem_fun (*this, &ProcessorBox::report_failed_reorder));
+ }
+}
- /* reorder failed, so redisplay */
-
- redisplay_processors ();
-
- /* now tell them about the problem */
-
- ArdourDialog dialog (_("Plugin Incompatibility"));
- Label label;
-
- label.set_text (_("\
+void
+ProcessorBox::report_failed_reorder ()
+{
+ /* reorder failed, so redisplay */
+
+ redisplay_processors ();
+
+ /* now tell them about the problem */
+
+ ArdourDialog dialog (_("Plugin Incompatibility"));
+ Label label;
+
+ label.set_text (_("\
You cannot reorder these plugins/sends/inserts\n\
in that way because the inputs and\n\
outputs will not work correctly."));
- dialog.get_vbox()->set_border_width (12);
- dialog.get_vbox()->pack_start (label);
- dialog.add_button (Stock::OK, RESPONSE_ACCEPT);
-
- dialog.set_name (X_("PluginIODialog"));
- dialog.set_position (Gtk::WIN_POS_MOUSE);
- dialog.set_modal (true);
- dialog.show_all ();
-
- dialog.run ();
- }
+ dialog.get_vbox()->set_border_width (12);
+ dialog.get_vbox()->pack_start (label);
+ dialog.add_button (Stock::OK, RESPONSE_ACCEPT);
+
+ dialog.set_name (X_("PluginIODialog"));
+ dialog.set_position (Gtk::WIN_POS_MOUSE);
+ dialog.set_modal (true);
+ dialog.show_all ();
+
+ dialog.run ();
}
void
diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h
index 971ad40176..785809e142 100644
--- a/gtk2_ardour/processor_box.h
+++ b/gtk2_ardour/processor_box.h
@@ -244,6 +244,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
void redisplay_processors ();
void add_processor_to_display (boost::weak_ptr<ARDOUR::Processor>);
void reordered ();
+ void report_failed_reorder ();
void route_processors_changed (ARDOUR::RouteProcessorChange);
void processors_reordered (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&, int*);