From 489d5bbec6c19a6e8beade82428e5cb433e3c3ed Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 7 Feb 2012 01:22:06 +0000 Subject: [PATCH] Ignore the Maximize option for dialogs which aren't supposed to be maximizable. Closes #1451. Originally committed to SVN as r6446. --- aegisub/src/persist_location.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aegisub/src/persist_location.cpp b/aegisub/src/persist_location.cpp index 3939c72b0..13408712a 100644 --- a/aegisub/src/persist_location.cpp +++ b/aegisub/src/persist_location.cpp @@ -37,9 +37,6 @@ PersistLocation::PersistLocation(wxDialog *dialog, std::string options_prefix) , maximize_opt(OPT_SET(options_prefix + "/Maximized")) , dialog(dialog) { - dialog->Bind(wxEVT_MOVE, &PersistLocation::OnMove, this); - dialog->Bind(wxEVT_SIZE, &PersistLocation::OnSize, this); - int x = x_opt->GetInt(); int y = y_opt->GetInt(); if (x == -1 && y == -1) @@ -76,7 +73,13 @@ PersistLocation::PersistLocation(wxDialog *dialog, std::string options_prefix) dialog->Move(x, y); } - if (maximize_opt->GetBool()) dialog->Maximize(); + dialog->Bind(wxEVT_MOVE, &PersistLocation::OnMove, this); + + if (dialog->GetWindowStyle() & wxMAXIMIZE_BOX) { + dialog->Bind(wxEVT_SIZE, &PersistLocation::OnSize, this); + if (maximize_opt->GetBool()) + dialog->Maximize(); + } } void PersistLocation::OnMove(wxMoveEvent &e) {