From 7aaf3ef50a4cfc6182cda4fa06fc1120fad5f2c0 Mon Sep 17 00:00:00 2001 From: "maosheng.wei" Date: Wed, 27 Dec 2023 16:38:17 +0800 Subject: [PATCH] FIX: Guide page can't show in screen with mainframe Jira: STUDIO-4911 Change-Id: I7e89614e0f1585263456c847a1b38dcfd0ad59e6 --- src/slic3r/GUI/WebGuideDialog.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index 423088b33..a125e4110 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -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;