From 6dc91348d7cc939228a3e288171757492e072caa Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 16 Nov 2020 15:47:05 +0100 Subject: [PATCH] Fix transient parent for plugin windows w/detached mixer This follows f3fbf58185367 which unconditionally set the main window as transient parent. However when detaching the mixer, plugins should be transient for the detached parent window. --- gtk2_ardour/processor_box.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 3af59fd67d..d963cf48d7 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -4238,6 +4238,10 @@ ProcessorBox::edit_processor (boost::shared_ptr processor) if (proxy) { proxy->set_custom_ui_mode (true); proxy->show_the_right_window (); + + Gtk::Window* tlw = dynamic_cast (get_toplevel ()); + assert (tlw && proxy->get (false)); + proxy->get ()->set_transient_for (*tlw); } } @@ -4259,6 +4263,10 @@ ProcessorBox::generic_edit_processor (boost::shared_ptr processor) if (proxy) { proxy->set_custom_ui_mode (false); proxy->show_the_right_window (); + + Gtk::Window* tlw = dynamic_cast (get_toplevel ()); + assert (tlw && proxy->get (false)); + proxy->get ()->set_transient_for (*tlw); } } @@ -4272,6 +4280,10 @@ ProcessorBox::manage_pins (boost::shared_ptr processor) if (proxy) { proxy->get (true); proxy->present(); + + Gtk::Window* tlw = dynamic_cast (get_toplevel ()); + assert (tlw); + proxy->get ()->set_transient_for (*tlw); } } @@ -4557,6 +4569,11 @@ ProcessorWindowProxy::show_the_right_window (bool show_not_toggle) return; } toggle (); + + if (_window) { + /* clear any transients if window is toggled externally (ctrl surfaces) */ + _window->unset_transient_for (); + } }