diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-07-09 19:22:06 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-02-22 15:31:22 -0500 |
commit | e3db5c5c0555b755ac42cbc5329390c78ce61946 (patch) | |
tree | eea3f2d2b19bf641d294b7bf9f17e106b05248bb /gtk2_ardour/ardour_ui_ed.cc | |
parent | 37fce09a18afe93460baefc15a700633a034d5e3 (diff) |
save & restore the main window geometry
Diffstat (limited to 'gtk2_ardour/ardour_ui_ed.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 20d2153005..8564cf1f1d 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -637,6 +637,18 @@ ARDOUR_UI::save_ardour_state () XMLNode* window_node = new XMLNode (X_("UI")); window_node->add_property (_status_bar_visibility.get_state_name().c_str(), _status_bar_visibility.get_state_value ()); + /* main window */ + + gint mx, my, mw, mh; + _main_window.get_position (mx, my); + _main_window.get_size (mw, mh); + + XMLNode main_window_node (X_("Main")); + main_window_node.add_property (X_("x"), PBD::to_string (mx, std::dec)); + main_window_node.add_property (X_("y"), PBD::to_string (my, std::dec)); + main_window_node.add_property (X_("w"), PBD::to_string (mw, std::dec)); + main_window_node.add_property (X_("h"), PBD::to_string (mh, std::dec)); + /* Windows */ WM::Manager::instance().add_state (*window_node); @@ -677,6 +689,7 @@ ARDOUR_UI::save_ardour_state () UIConfiguration::instance().save_state (); if (_session) { + _session->add_instant_xml (main_window_node); _session->add_instant_xml (enode); _session->add_instant_xml (mnode); _session->add_instant_xml (bnode); @@ -684,6 +697,7 @@ ARDOUR_UI::save_ardour_state () _session->add_instant_xml (location_ui->ui().get_state ()); } } else { + Config->add_instant_xml (main_window_node); Config->add_instant_xml (enode); Config->add_instant_xml (mnode); Config->add_instant_xml (bnode); |