13
0

Fix save/restore window and tab sizes

Window size has to be set before calling `setup_toplevel_window()`.
and `set_show_tabs()` - see also acf13e9498 and 42cb321039.

This also unconditionally saves the current settings to global config
instant.xml. This was previously only done in rare cases when first
closing the session and then quitting Ardour.
This commit is contained in:
Robin Gareus 2022-09-03 17:39:24 +02:00
parent 96a9c1df7f
commit 1228202bbe
3 changed files with 10 additions and 6 deletions

View File

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

View File

@ -344,6 +344,7 @@ ARDOUR_UI::setup_windows ()
_main_window.add (main_vpacker);
transport_frame.show_all ();
apply_window_settings (true);
setup_toplevel_window (_main_window, "", this);
_main_window.show_all ();
@ -360,16 +361,16 @@ ARDOUR_UI::setup_windows ()
LV2Plugin::set_main_window_id (GDK_DRAWABLE_XID(_main_window.get_window()->gobj()));
#endif
return apply_window_settings (true);
return 0;
}
int
void
ARDOUR_UI::apply_window_settings (bool with_size)
{
const XMLNode* mnode = main_window_settings ();
if (!mnode) {
return 0;
return;
}
XMLProperty const* prop;
@ -428,7 +429,7 @@ ARDOUR_UI::apply_window_settings (bool with_size)
} else if (editor) {
_tabs.set_current_page (_tabs.page_num (editor->contents()));
}
return 0;
return;
}
bool

View File

@ -965,7 +965,10 @@ ARDOUR_UI::save_ardour_state ()
vkstate.add_child_nocopy (virtual_keyboard_window.get_state ());
_session->add_instant_xml (vkstate);
}
} else {
}
/* save current Window settings and sizes for new sessions */
{
Config->add_instant_xml (main_window_node);
Config->add_instant_xml (enode);
Config->add_instant_xml (mnode);