mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
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:
parent
bfedf7168e
commit
acf13e9498
3 changed files with 70 additions and 56 deletions
|
|
@ -445,6 +445,7 @@ private:
|
||||||
void toggle_meterbridge ();
|
void toggle_meterbridge ();
|
||||||
|
|
||||||
int setup_windows ();
|
int setup_windows ();
|
||||||
|
int apply_window_settings (bool);
|
||||||
void setup_transport ();
|
void setup_transport ();
|
||||||
void setup_clock ();
|
void setup_clock ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -344,9 +344,34 @@ ARDOUR_UI::setup_windows ()
|
||||||
_main_window.add (main_vpacker);
|
_main_window.add (main_vpacker);
|
||||||
transport_frame.show_all ();
|
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 ();
|
const XMLNode* mnode = main_window_settings ();
|
||||||
|
|
||||||
if (mnode) {
|
if (!mnode) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
XMLProperty const * prop;
|
XMLProperty const * prop;
|
||||||
gint x = -1;
|
gint x = -1;
|
||||||
gint y = -1;
|
gint y = -1;
|
||||||
|
|
@ -388,6 +413,10 @@ ARDOUR_UI::setup_windows ()
|
||||||
} else {
|
} else {
|
||||||
current_tab = "editor";
|
current_tab = "editor";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cout << "CURRENT TAB: " << current_tab << "\n";
|
||||||
|
|
||||||
|
|
||||||
if (mixer && current_tab == "mixer") {
|
if (mixer && current_tab == "mixer") {
|
||||||
_tabs.set_current_page (_tabs.page_num (mixer->contents()));
|
_tabs.set_current_page (_tabs.page_num (mixer->contents()));
|
||||||
} else if (rc_option_editor && current_tab == "preferences") {
|
} else if (rc_option_editor && current_tab == "preferences") {
|
||||||
|
|
@ -399,23 +428,6 @@ ARDOUR_UI::setup_windows ()
|
||||||
} else if (editor) {
|
} else if (editor) {
|
||||||
_tabs.set_current_page (_tabs.page_num (editor->contents()));
|
_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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,7 @@ ARDOUR_UI::set_session (Session *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
WM::Manager::instance().set_session (s);
|
WM::Manager::instance().set_session (s);
|
||||||
|
apply_window_settings (false);
|
||||||
|
|
||||||
AutomationWatch::instance().set_session (s);
|
AutomationWatch::instance().set_session (s);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue