From cc7b2c5de6238a092c831c6012657c4cd30e0f89 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 15 Jun 2012 19:41:52 +0000 Subject: [PATCH] for AU plugin GUIs, since configure events don't seem to be handled correctly in GTK/Quartz, store and restore window positions at show+hide as well as app activate and deactivate git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@12730 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/plugin_ui.cc | 17 +++++++++++++++++ gtk2_ardour/plugin_ui.h | 5 +++++ 2 files changed, 22 insertions(+) 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);