From 1acf8bdc674ac0ebfd5fc39885c7fe9e70840960 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 19 May 2013 02:28:36 +0200 Subject: [PATCH] Restore 'Edit with basic controls' plugin UI functionality. Regression was introduced in 40944574c Compared to before 40944574c it is no longer possible to have both custom and basic open at the same time. On the upside window stacking and raise-to-top works properly. --- gtk2_ardour/processor_box.cc | 18 ++++++++++-------- gtk2_ardour/processor_box.h | 4 +++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 2782d2cff8..9ac57a356c 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -2040,7 +2040,7 @@ ProcessorBox::one_processor_can_be_edited () } Gtk::Window* -ProcessorBox::get_editor_window (boost::shared_ptr processor) +ProcessorBox::get_editor_window (boost::shared_ptr processor, bool use_custom) { boost::shared_ptr send; boost::shared_ptr internal_send; @@ -2119,8 +2119,7 @@ ProcessorBox::get_editor_window (boost::shared_ptr processor) Window* w = get_processor_ui (plugin_insert); if (w == 0) { - - plugin_ui = new PluginUIWindow (plugin_insert, false, Config->get_use_plugin_own_gui()); + plugin_ui = new PluginUIWindow (plugin_insert, false, use_custom); plugin_ui->set_title (generate_processor_title (plugin_insert)); set_processor_ui (plugin_insert, plugin_ui); @@ -2438,6 +2437,7 @@ ProcessorBox::edit_processor (boost::shared_ptr processor) ProcessorWindowProxy* proxy = find_window_proxy (processor); if (proxy) { + proxy->set_custom_ui_mode (Config->get_use_plugin_own_gui ()); proxy->toggle (); } } @@ -2452,6 +2452,7 @@ ProcessorBox::generic_edit_processor (boost::shared_ptr processor) ProcessorWindowProxy* proxy = find_window_proxy (processor); if (proxy) { + proxy->set_custom_ui_mode (false); proxy->toggle (); } } @@ -2629,6 +2630,7 @@ ProcessorWindowProxy::ProcessorWindowProxy (string const & name, ProcessorBox* b , _processor_box (box) , _processor (processor) , is_custom (false) + , want_custom (false) { } @@ -2648,8 +2650,7 @@ ProcessorWindowProxy::get (bool create) if (!p) { return 0; } - - if (_window && (is_custom != Config->get_use_plugin_own_gui ())) { + if (_window && (is_custom != want_custom)) { /* drop existing window - wrong type */ drop_window (); } @@ -2659,8 +2660,8 @@ ProcessorWindowProxy::get (bool create) return 0; } - _window = _processor_box->get_editor_window (p); - is_custom = Config->get_use_plugin_own_gui(); + is_custom = want_custom; + _window = _processor_box->get_editor_window (p, is_custom); if (_window) { setup (); @@ -2673,10 +2674,11 @@ ProcessorWindowProxy::get (bool create) void ProcessorWindowProxy::toggle () { - if (_window && (is_custom != Config->get_use_plugin_own_gui ())) { + if (_window && (is_custom != want_custom)) { /* drop existing window - wrong type */ drop_window (); } + is_custom = want_custom; WM::ProxyBase::toggle (); } diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index c279ffa917..7d80abdc68 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -88,6 +88,7 @@ class ProcessorWindowProxy : public WM::ProxyBase ARDOUR::SessionHandlePtr* session_handle(); void toggle(); + void set_custom_ui_mode(bool use_custom) { want_custom = use_custom; } bool marked; @@ -95,6 +96,7 @@ class ProcessorWindowProxy : public WM::ProxyBase ProcessorBox* _processor_box; boost::weak_ptr _processor; bool is_custom; + bool want_custom; }; class ProcessorEntry : public Gtkmm2ext::DnDVBoxChild, public sigc::trackable @@ -257,7 +259,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD Gtk::Window* get_processor_ui (boost::shared_ptr) const; /* a WindowProxy object can use this */ - Gtk::Window* get_editor_window (boost::shared_ptr); + Gtk::Window* get_editor_window (boost::shared_ptr, bool); Gtk::Window* get_generic_editor_window (boost::shared_ptr); void edit_processor (boost::shared_ptr);