Catch another windows no-top-level issue

GTK+ on windows is weird on occasion :)
This commit is contained in:
Robin Gareus 2023-05-15 22:47:12 +02:00
parent 4b30239275
commit 68d910d58c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
5 changed files with 32 additions and 4 deletions

View File

@ -339,4 +339,15 @@ PortInsertWindow::PortInsertWindow (Gtk::Window& parent, ARDOUR::Session* s, std
{
set_name ("IOSelectorWindow");
add (_portinsertui);
_portinsertui.show ();
}
PortInsertWindow::PortInsertWindow (ARDOUR::Session* s, std::shared_ptr<ARDOUR::PortInsert> pi)
: ArdourWindow (string_compose (_("Port Insert: %1"), pi->name ()))
, _portinsertui (this, s, pi)
{
set_name ("IOSelectorWindow");
add (_portinsertui);
_portinsertui.show ();
}

View File

@ -91,6 +91,7 @@ class PortInsertWindow : public ArdourWindow
{
public:
PortInsertWindow (Gtk::Window&, ARDOUR::Session*, std::shared_ptr<ARDOUR::PortInsert>);
PortInsertWindow (ARDOUR::Session*, std::shared_ptr<ARDOUR::PortInsert>);
private:
PortInsertUI _portinsertui;

View File

@ -3984,8 +3984,11 @@ ProcessorBox::get_editor_window (std::shared_ptr<Processor> processor, bool use_
if (std::dynamic_pointer_cast<InternalSend> (processor) == 0) {
Gtk::Window* tlw = dynamic_cast<Gtk::Window*> (get_toplevel ());
assert (tlw);
gidget = new SendUIWindow (*tlw, _session, send);
if (tlw) {
gidget = new SendUIWindow (*tlw, _session, send);
} else {
gidget = new SendUIWindow (_session, send);
}
}
} else if ((retrn = std::dynamic_pointer_cast<Return> (processor)) != 0) {
@ -4047,8 +4050,11 @@ ProcessorBox::get_editor_window (std::shared_ptr<Processor> processor, bool use_
if (w == 0) {
Gtk::Window* tlw = dynamic_cast<Gtk::Window*> (get_toplevel ());
assert (tlw);
io_selector = new PortInsertWindow (*tlw, _session, port_insert);
if (tlw) {
io_selector = new PortInsertWindow (*tlw, _session, port_insert);
} else {
io_selector = new PortInsertWindow (_session, port_insert);
}
set_processor_ui (port_insert, io_selector);
} else {

View File

@ -159,3 +159,12 @@ SendUIWindow::SendUIWindow (Gtk::Window& parent, ARDOUR::Session* session, std::
add (_ui);
_ui.show ();
}
SendUIWindow::SendUIWindow (ARDOUR::Session* session, std::shared_ptr<Send> send)
: ArdourWindow (string_compose (_("Send: %1"), send->name ()))
, _ui (this, session, send)
{
set_name ("SendUIWindow");
add (_ui);
_ui.show ();
}

View File

@ -65,6 +65,7 @@ class SendUIWindow : public ArdourWindow
{
public:
SendUIWindow (Gtk::Window&, ARDOUR::Session*, std::shared_ptr<ARDOUR::Send>);
SendUIWindow (ARDOUR::Session*, std::shared_ptr<ARDOUR::Send>);
private:
SendUI _ui;