diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index 5b281f33ab..bab081b600 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -82,11 +82,10 @@ using namespace Gtkmm2ext; using namespace Gtk; PluginUIWindow::PluginUIWindow ( - Gtk::Window* win, boost::shared_ptr insert, bool scrollable, bool editor) - : parent (win) + : ArdourWindow (string()) , was_visible (false) , _keyboard_focused (false) #ifdef AUDIOUNIT_SUPPORT @@ -96,7 +95,6 @@ PluginUIWindow::PluginUIWindow ( { bool have_gui = false; - Label* label = manage (new Label()); label->set_markup ("THIS IS THE PLUGIN UI"); @@ -147,7 +145,6 @@ PluginUIWindow::PluginUIWindow ( signal_unmap_event().connect (sigc::mem_fun (*pu, &GenericPluginUI::stop_updating)); } - // set_position (Gtk::WIN_POS_MOUSE); set_name ("PluginEditor"); add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK); @@ -163,6 +160,7 @@ PluginUIWindow::PluginUIWindow ( set_default_size (w, h); set_resizable (_pluginui->resizable()); + set_position (Gtk::WIN_POS_MOUSE); } PluginUIWindow::~PluginUIWindow () @@ -170,19 +168,10 @@ PluginUIWindow::~PluginUIWindow () delete _pluginui; } -void -PluginUIWindow::set_parent (Gtk::Window* win) -{ - parent = win; -} - void PluginUIWindow::on_map () { Window::on_map (); -#ifdef __APPLE__ - set_keep_above (true); -#endif // __APPLE__ } bool @@ -236,10 +225,6 @@ PluginUIWindow::on_show () Window::on_show (); } } - - if (parent) { - // set_transient_for (*parent); - } } void diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h index 6b886cf268..be03e6ede4 100644 --- a/gtk2_ardour/plugin_ui.h +++ b/gtk2_ardour/plugin_ui.h @@ -50,6 +50,7 @@ #include "automation_controller.h" #include "ardour_button.h" +#include "ardour_window.h" namespace ARDOUR { class PluginInsert; @@ -278,11 +279,10 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox bool integer_printer (char* buf, Gtk::Adjustment &, ControlUI *); }; -class PluginUIWindow : public Gtk::Window +class PluginUIWindow : public ArdourWindow { public: - PluginUIWindow (Gtk::Window*, - boost::shared_ptr insert, + PluginUIWindow (boost::shared_ptr insert, bool scrollable=false, bool editor=true); ~PluginUIWindow (); diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 16088786cd..3618f437a2 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -2094,20 +2094,16 @@ ProcessorBox::toggle_edit_processor (boost::shared_ptr processor) /* these are both allowed to be null */ - Container* toplevel = get_toplevel(); - Window* win = dynamic_cast(toplevel); - Window* w = get_processor_ui (plugin_insert); if (w == 0) { - plugin_ui = new PluginUIWindow (win, plugin_insert); + plugin_ui = new PluginUIWindow (plugin_insert); plugin_ui->set_title (generate_processor_title (plugin_insert)); set_processor_ui (plugin_insert, plugin_ui); } else { plugin_ui = dynamic_cast (w); - plugin_ui->set_parent (win); } gidget = plugin_ui; @@ -2155,9 +2151,7 @@ ProcessorBox::toggle_edit_generic_processor (boost::shared_ptr proces return; } - Container* toplevel = get_toplevel(); - Window* win = dynamic_cast(toplevel); - PluginUIWindow* plugin_ui = new PluginUIWindow(win, plugin_insert, true, false); + PluginUIWindow* plugin_ui = new PluginUIWindow (plugin_insert, true, false); plugin_ui->set_title(generate_processor_title (plugin_insert)); if (plugin_ui->is_visible()) {