diff --git a/aegisub/src/persist_location.cpp b/aegisub/src/persist_location.cpp index b6c654919..95c05e05b 100644 --- a/aegisub/src/persist_location.cpp +++ b/aegisub/src/persist_location.cpp @@ -35,6 +35,7 @@ PersistLocation::PersistLocation(wxDialog *dialog, std::string options_prefix) : x_opt(OPT_SET(options_prefix + "/Last/X")) , y_opt(OPT_SET(options_prefix + "/Last/Y")) , maximize_opt(OPT_SET(options_prefix + "/Maximized")) +, dialog(dialog) { dialog->Bind(wxEVT_MOVE, &PersistLocation::OnMove, this); dialog->Bind(wxEVT_ICONIZE, &PersistLocation::OnMinimize, this); @@ -78,8 +79,8 @@ PersistLocation::PersistLocation(wxDialog *dialog, std::string options_prefix) } } -void PersistLocation::OnMove(wxMoveEvent &evt) { - wxPoint pos = evt.GetPosition(); +void PersistLocation::OnMove(wxMoveEvent &) { + wxPoint pos = dialog->GetPosition(); x_opt->SetInt(pos.x); y_opt->SetInt(pos.y); } diff --git a/aegisub/src/persist_location.h b/aegisub/src/persist_location.h index 105b62dc5..07c50368b 100644 --- a/aegisub/src/persist_location.h +++ b/aegisub/src/persist_location.h @@ -40,8 +40,9 @@ class PersistLocation { agi::OptionValue *x_opt; agi::OptionValue *y_opt; agi::OptionValue *maximize_opt; + class wxDialog *dialog; - void OnMove(wxMoveEvent &evt); + void OnMove(wxMoveEvent &); void OnMinimize(wxIconizeEvent &evt); public: