diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index 4baae1829d..63731d506a 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -71,6 +71,10 @@ PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr= 0) { + move (pre_deactivate_x, pre_deactivate_y); + } +#endif if (_pluginui->on_window_show (_title)) { Window::on_show (); } @@ -212,6 +221,10 @@ PluginUIWindow::on_show () void PluginUIWindow::on_hide () { +#if defined (HAVE_AUDIOUNITS) && defined(GTKOSX) + get_position (pre_deactivate_x, pre_deactivate_y); +#endif + Window::on_hide (); if (_pluginui) { @@ -277,12 +290,16 @@ PluginUIWindow::app_activated (bool yn) if (yn) { if (was_visible) { _pluginui->activate (); + if (pre_deactivate_x >= 0) { + move (pre_deactivate_x, pre_deactivate_y); + } // present (); show (); was_visible = true; } } else { was_visible = is_visible(); + get_position (pre_deactivate_x, pre_deactivate_y); hide (); _pluginui->deactivate (); } diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h index 330b4dd171..3c9844b10f 100644 --- a/gtk2_ardour/plugin_ui.h +++ b/gtk2_ardour/plugin_ui.h @@ -249,6 +249,11 @@ class PluginUIWindow : public Gtk::Window Gtk::VBox vbox; bool was_visible; bool _keyboard_focused; +#ifdef HAVE_AUDIOUNITS + int pre_deactivate_x; + int pre_deactivate_y; +#endif + void keyboard_focused (bool yn); void app_activated (bool);