Restore "Main" UI Tab setting from sesion instant.xml

Previously this setting was ignored. It is relevant when loading a demo
session, where initially there is no user Config instant.xml.

ARDOUR_UI::setup_windows is called directly after the engine starts, but
before the session is set.
This commit is contained in:
Robin Gareus 2022-08-10 00:46:54 +02:00
parent bfedf7168e
commit acf13e9498
3 changed files with 70 additions and 56 deletions

View file

@ -445,6 +445,7 @@ private:
void toggle_meterbridge ();
int setup_windows ();
int apply_window_settings (bool);
void setup_transport ();
void setup_clock ();

View file

@ -344,9 +344,34 @@ ARDOUR_UI::setup_windows ()
_main_window.add (main_vpacker);
transport_frame.show_all ();
setup_toplevel_window (_main_window, "", this);
_main_window.show_all ();
_tabs.set_show_tabs (false);
/* It would be nice if Gtkmm had wrapped this rather than just
* deprecating the old set_window_creation_hook() method, but oh well...
*/
g_signal_connect (_tabs.gobj(), "create-window", (GCallback) ::tab_window_root_drop, this);
#ifdef GDK_WINDOWING_X11
/* allow externalUIs to be transient, on top of the main window */
LV2Plugin::set_main_window_id (GDK_DRAWABLE_XID(_main_window.get_window()->gobj()));
#endif
return apply_window_settings (true);
}
int
ARDOUR_UI::apply_window_settings (bool with_size)
{
const XMLNode* mnode = main_window_settings ();
if (mnode) {
if (!mnode) {
return 0;
}
XMLProperty const * prop;
gint x = -1;
gint y = -1;
@ -388,6 +413,10 @@ ARDOUR_UI::setup_windows ()
} else {
current_tab = "editor";
}
std::cout << "CURRENT TAB: " << current_tab << "\n";
if (mixer && current_tab == "mixer") {
_tabs.set_current_page (_tabs.page_num (mixer->contents()));
} else if (rc_option_editor && current_tab == "preferences") {
@ -399,23 +428,6 @@ ARDOUR_UI::setup_windows ()
} else if (editor) {
_tabs.set_current_page (_tabs.page_num (editor->contents()));
}
}
setup_toplevel_window (_main_window, "", this);
_main_window.show_all ();
_tabs.set_show_tabs (false);
/* It would be nice if Gtkmm had wrapped this rather than just
* deprecating the old set_window_creation_hook() method, but oh well...
*/
g_signal_connect (_tabs.gobj(), "create-window", (GCallback) ::tab_window_root_drop, this);
#ifdef GDK_WINDOWING_X11
/* allow externalUIs to be transient, on top of the main window */
LV2Plugin::set_main_window_id (GDK_DRAWABLE_XID(_main_window.get_window()->gobj()));
#endif
return 0;
}

View file

@ -143,6 +143,7 @@ ARDOUR_UI::set_session (Session *s)
}
WM::Manager::instance().set_session (s);
apply_window_settings (false);
AutomationWatch::instance().set_session (s);