FIX: Guide page can't show in screen with mainframe

Jira: STUDIO-4911

Change-Id: I7e89614e0f1585263456c847a1b38dcfd0ad59e6
This commit is contained in:
maosheng.wei 2023-12-27 16:38:17 +08:00 committed by Lane.Wei
parent e482763f8e
commit 7aaf3ef50a
1 changed files with 11 additions and 0 deletions

View File

@ -909,6 +909,17 @@ bool GuideFrame::run()
app.preset_bundle->export_selections(*app.app_config);
BOOST_LOG_TRIVIAL(info) << "GuideFrame before ShowModal";
// display position
int main_frame_display_index = wxDisplay::GetFromWindow(wxGetApp().mainframe);
int guide_display_index = wxDisplay::GetFromWindow(this);
if (main_frame_display_index != guide_display_index) {
wxDisplay display = wxDisplay(main_frame_display_index);
wxRect screenRect = display.GetGeometry();
int guide_x = screenRect.x + (screenRect.width - this->GetSize().GetWidth()) / 2;
int guide_y = screenRect.y + (screenRect.height - this->GetSize().GetHeight()) / 2;
this->SetPosition(wxPoint(guide_x, guide_y));
}
int result = this->ShowModal();
if (result == wxID_OK) {
bool apply_keeped_changes = false;