From a1319cc8f708b316897bd586f936f6467037038f Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Thu, 11 Jun 2020 16:07:28 +0200 Subject: [PATCH] Fixed restoring of application starting position --- src/slic3r/GUI/GUI_App.cpp | 4 +++- src/slic3r/GUI/GUI_Utils.hpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 9dfb4b422..440efe0a5 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1394,7 +1394,9 @@ void GUI_App::window_pos_restore(wxTopLevelWindow* window, const std::string &na return; } - window->SetSize(metrics->get_rect()); + const wxRect& rect = metrics->get_rect(); + window->SetPosition(rect.GetPosition()); + window->SetSize(rect.GetSize()); window->Maximize(metrics->get_maximized()); } diff --git a/src/slic3r/GUI/GUI_Utils.hpp b/src/slic3r/GUI/GUI_Utils.hpp index 934845fb3..a2f939fac 100644 --- a/src/slic3r/GUI/GUI_Utils.hpp +++ b/src/slic3r/GUI/GUI_Utils.hpp @@ -341,7 +341,7 @@ public: static WindowMetrics from_window(wxTopLevelWindow *window); static boost::optional deserialize(const std::string &str); - wxRect get_rect() const { return rect; } + const wxRect& get_rect() const { return rect; } bool get_maximized() const { return maximized; } void sanitize_for_display(const wxRect &screen_rect);