mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Fix save/restore window and tab sizes
Window size has to be set before calling `setup_toplevel_window()`. and `set_show_tabs()` - see alsoacf13e9498and42cb321039. 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:
parent
96a9c1df7f
commit
1228202bbe
3 changed files with 10 additions and 6 deletions
|
|
@ -445,7 +445,7 @@ private:
|
||||||
void toggle_meterbridge ();
|
void toggle_meterbridge ();
|
||||||
|
|
||||||
int setup_windows ();
|
int setup_windows ();
|
||||||
int apply_window_settings (bool);
|
void apply_window_settings (bool);
|
||||||
void setup_transport ();
|
void setup_transport ();
|
||||||
void setup_clock ();
|
void setup_clock ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -344,6 +344,7 @@ ARDOUR_UI::setup_windows ()
|
||||||
_main_window.add (main_vpacker);
|
_main_window.add (main_vpacker);
|
||||||
transport_frame.show_all ();
|
transport_frame.show_all ();
|
||||||
|
|
||||||
|
apply_window_settings (true);
|
||||||
|
|
||||||
setup_toplevel_window (_main_window, "", this);
|
setup_toplevel_window (_main_window, "", this);
|
||||||
_main_window.show_all ();
|
_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()));
|
LV2Plugin::set_main_window_id (GDK_DRAWABLE_XID(_main_window.get_window()->gobj()));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return apply_window_settings (true);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
ARDOUR_UI::apply_window_settings (bool with_size)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
XMLProperty const* prop;
|
XMLProperty const* prop;
|
||||||
|
|
@ -428,7 +429,7 @@ ARDOUR_UI::apply_window_settings (bool with_size)
|
||||||
} else if (editor) {
|
} else if (editor) {
|
||||||
_tabs.set_current_page (_tabs.page_num (editor->contents()));
|
_tabs.set_current_page (_tabs.page_num (editor->contents()));
|
||||||
}
|
}
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -965,7 +965,10 @@ ARDOUR_UI::save_ardour_state ()
|
||||||
vkstate.add_child_nocopy (virtual_keyboard_window.get_state ());
|
vkstate.add_child_nocopy (virtual_keyboard_window.get_state ());
|
||||||
_session->add_instant_xml (vkstate);
|
_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 (main_window_node);
|
||||||
Config->add_instant_xml (enode);
|
Config->add_instant_xml (enode);
|
||||||
Config->add_instant_xml (mnode);
|
Config->add_instant_xml (mnode);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue