diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-03-09 01:04:41 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-09-28 19:49:26 +0200 |
| commit | bceeb1bcd7d56eb29a8f211e8cf258a0a7c720b4 (patch) | |
| tree | 1f832e4812c9a5f430a984104137ee0ac41c5c51 | |
| parent | 68256c8a5b194acd2d5cd211c731dd6154add1c6 (diff) | |
Save and restore DoM player window position/size.
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 32c6c980b..f73f73a8b 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -34,6 +34,7 @@ #include "wx/timer_display.h" #include "wx/update_dialog.h" #include "wx/verify_dcp_dialog.h" +#include "wx/window_metrics.h" #include "wx/wx_ptr.h" #include "wx/wx_signal_manager.h" #include "wx/wx_util.h" @@ -211,6 +212,7 @@ public: , _overall_panel(new wxPanel(this, wxID_ANY)) , _viewer(_overall_panel) , _main_sizer (new wxBoxSizer(wxVERTICAL)) + , _metrics(std::string{"dcpomatic-player"}, wxDefaultSize, this) { dcpomatic_log = make_shared<NullLog>(); @@ -319,6 +321,8 @@ public: setup_http_server(); SetDropTarget(new DCPDropTarget(this)); + + _metrics.bind(); } ~DOMFrame () @@ -336,6 +340,11 @@ public: } } + void show() + { + _metrics.show(); + } + void close(wxCloseEvent& ev) { FontConfig::drop(); @@ -1289,6 +1298,7 @@ private: boost::thread _http_server_thread; std::unique_ptr<HTTPServer> _http_server; struct timeval _last_http_server_update = { 0, 0 }; + WindowMetrics _metrics; }; static const wxCmdLineEntryDesc command_line_description[] = { @@ -1364,12 +1374,11 @@ private: _frame = new DOMFrame (); SetTopWindow (_frame); - _frame->Maximize (); if (splash) { splash->Destroy (); splash = nullptr; } - _frame->Show (); + _frame->show(); if (_dcp_to_load && dcp::filesystem::is_directory(*_dcp_to_load)) { try { |
