From 22a6bf999fc70a30b156c28799d041798bbc5463 Mon Sep 17 00:00:00 2001 From: Huibean Date: Sat, 18 Nov 2023 21:51:28 +0800 Subject: [PATCH] Add frame window monitor display index compare with saved dialog and centre it if display changed which caused dialog disapper (cherry picked from commit 530b72972dd4a50438b43763f841d4f141011aa6) --- common/dialog_shim.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/dialog_shim.cpp b/common/dialog_shim.cpp index 2980c6c3df..45d149250d 100644 --- a/common/dialog_shim.cpp +++ b/common/dialog_shim.cpp @@ -288,6 +288,14 @@ bool DIALOG_SHIM::Show( bool show ) std::max( wxDialog::GetSize().y, savedDialogRect.GetSize().y ), 0 ); } +#ifdef __WXMAC__ + if( m_parent != nullptr ) + { + if( wxDisplay::GetFromPoint( m_parent->GetPosition() ) + != wxDisplay::GetFromPoint( savedDialogRect.GetPosition() ) ) + Centre(); + } +#endif } else if( m_initialSize != wxDefaultSize ) SetSize( m_initialSize );