Fix window parent when using different workspaces

This affects only windows opened from the mixer window,
in case the mixer is detached and on a different workspace (desktop).

Window::init (and Dialog::init) set transient parent early on,
and it defaults to the main window (with toolbar). It needs to be
unset before presenting the window, in order to show the window
on the same workspace as the eventual transient parent.

This follows 6dc9134 and f3fbf58.
This commit is contained in:
Robin Gareus 2020-11-18 16:26:36 +01:00
parent ff51e315e3
commit 94af225eaf
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
4 changed files with 8 additions and 3 deletions

View file

@ -110,6 +110,9 @@ LoudnessDialog::LoudnessDialog (Session* s, AudioRange const& ar, bool as)
, _ignore_preset (false)
, _ignore_change (false)
{
/* Dialog can be displayed from the mixer, override global transient_parent */
unset_transient_for ();
/* query initial gain */
_gain_out = accurate_coefficient_to_dB (_session->master_volume()->get_value());

View file

@ -2004,6 +2004,7 @@ PluginPinDialog::PluginPinDialog (boost::shared_ptr<ARDOUR::PluginInsert> pi)
{
ppw.push_back (PluginPinWidgetPtr(new PluginPinWidget (pi)));
add (*ppw.back());
unset_transient_for ();
}

View file

@ -189,6 +189,7 @@ PluginUIWindow::PluginUIWindow (
set_border_width (0);
set_default_size (w, h);
set_resizable (_pluginui->resizable());
unset_transient_for ();
}
PluginUIWindow::~PluginUIWindow ()

View file

@ -4279,11 +4279,12 @@ ProcessorBox::manage_pins (boost::shared_ptr<Processor> processor)
PluginPinWindowProxy* proxy = processor->pinmgr_proxy ();
if (proxy) {
proxy->get (true);
proxy->present();
Gtk::Window* tlw = dynamic_cast<Gtk::Window*> (get_toplevel ());
assert (tlw);
proxy->get ()->set_transient_for (*tlw);
proxy->present();
}
}
@ -4568,12 +4569,11 @@ ProcessorWindowProxy::show_the_right_window (bool show_not_toggle)
if (_window && fully_visible () && show_not_toggle) {
return;
}
toggle ();
if (_window) {
/* clear any transients if window is toggled externally (ctrl surfaces) */
_window->unset_transient_for ();
}
toggle ();
}