From a27258a8be70968564b255eaede4566dcdfb86e5 Mon Sep 17 00:00:00 2001 From: supermerill Date: Wed, 13 May 2020 21:13:54 +0200 Subject: [PATCH] macos build fix --- src/slic3r/GUI/GUI_Preview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index c628b4fda..b60bd957d 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -20,6 +20,7 @@ #include #include #include +#include // this include must follow the wxWidgets ones or it won't compile on Windows -> see http://trac.wxwidgets.org/ticket/2421 #include "libslic3r/Print.hpp" @@ -210,7 +211,9 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Camera& camera, GLToolbar& view return false; //get display size to see if we have to compress the labels - wxDisplay display(wxDisplay::GetFromWindow(parent)); + + const auto idx = wxDisplay::GetFromWindow(parent); + wxDisplay display(idx != wxNOT_FOUND ? idx : 0u); wxRect screen = display.GetClientArea(); ScreenWidth width_screen = ScreenWidth::large; if (screen.width < 1900)