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_ui2.cc | |
parent | 37fce09a18afe93460baefc15a700633a034d5e3 (diff) |
save & restore the main window geometry
Diffstat (limited to 'gtk2_ardour/ardour_ui2.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui2.cc | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index 6205272c4b..b7ec0ed0e9 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -142,8 +142,46 @@ ARDOUR_UI::setup_windows () _main_window.add (main_vpacker); transport_frame.show_all (); - _main_window.show_all (); + const XMLNode* mnode = main_window_settings (); + + if (mnode) { + const XMLProperty* prop; + gint x = -1; + gint y = -1; + gint w = -1; + gint h = -1; + + if ((prop = mnode->property (X_("x"))) != 0) { + x = atoi (prop->value()); + } + + if ((prop = mnode->property (X_("y"))) != 0) { + y = atoi (prop->value()); + } + + if ((prop = mnode->property (X_("w"))) != 0) { + w = atoi (prop->value()); + } + + if ((prop = mnode->property (X_("h"))) != 0) { + h = atoi (prop->value()); + } + + if (x >= 0 && y >= 0 && w >= 0 && h >= 0) { + _main_window.set_position (Gtk::WIN_POS_NONE); + } + + if (x >= 0 && y >= 0) { + _main_window.move (x, y); + } + + if (w > 0 && h > 0) { + _main_window.set_default_size (w, h); + } + } + + _main_window.show_all (); setup_toplevel_window (_main_window, "", this); rc_option_editor = new RCOptionEditor; |