From 3ab1b69682b87db2bff6667245f0a4a3c4938f8e Mon Sep 17 00:00:00 2001
From: bubnikv <bubnikv@gmail.com>
Date: Fri, 12 Apr 2019 13:13:31 +0200
Subject: [PATCH 1/4] Fixed a bug in command line only win32 slic3r build.

---
 src/slic3r_app_msvc.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/slic3r_app_msvc.cpp b/src/slic3r_app_msvc.cpp
index bf72ee136..c100f8fd9 100644
--- a/src/slic3r_app_msvc.cpp
+++ b/src/slic3r_app_msvc.cpp
@@ -266,6 +266,8 @@ int wmain(int argc, wchar_t **argv)
 		} else
 			printf("MESA OpenGL library was loaded sucessfully\n");		
 	}
+#endif /* SLIC3R_GUI */
+
 
 	wchar_t path_to_slic3r[MAX_PATH + 1] = { 0 };
 	wcscpy(path_to_slic3r, path_to_exe);
@@ -276,7 +278,6 @@ int wmain(int argc, wchar_t **argv)
 		printf("slic3r.dll was not loaded\n");
 		return -1;
 	}
-#endif /* SLIC3R_GUI */
 
 	// resolve function address here
 	slic3r_main = (Slic3rMainFunc)GetProcAddress(hInstance_Slic3r, 

From 8614bb2eded6a59b0393224745cbc368039870a4 Mon Sep 17 00:00:00 2001
From: bubnikv <bubnikv@gmail.com>
Date: Fri, 12 Apr 2019 13:29:06 +0200
Subject: [PATCH 2/4] One more command line only slic3r build fix.

---
 src/slic3r.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/slic3r.cpp b/src/slic3r.cpp
index f6a2282bb..ff87b3f6d 100644
--- a/src/slic3r.cpp
+++ b/src/slic3r.cpp
@@ -40,8 +40,11 @@
 #include "libslic3r/Utils.hpp"
 
 #include "slic3r.hpp"
-#include "slic3r/GUI/GUI.hpp"
-#include "slic3r/GUI/GUI_App.hpp"
+
+#ifdef SLIC3R_GUI
+    #include "slic3r/GUI/GUI.hpp"
+    #include "slic3r/GUI/GUI_App.hpp"
+#endif /* SLIC3R_GUI */
 
 using namespace Slic3r;
 

From 17ad59c7e6cd2c96978682532e36e16052645541 Mon Sep 17 00:00:00 2001
From: bubnikv <bubnikv@gmail.com>
Date: Fri, 12 Apr 2019 13:33:06 +0200
Subject: [PATCH 3/4] Only show the "--software-renderer" option if GUI is
 compiled in.

---
 src/libslic3r/PrintConfig.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp
index 8c031bcaa..b3061ca61 100644
--- a/src/libslic3r/PrintConfig.cpp
+++ b/src/libslic3r/PrintConfig.cpp
@@ -3118,7 +3118,7 @@ CLIMiscConfigDef::CLIMiscConfigDef()
     def->tooltip = L("Messages with severity lower or eqal to the loglevel will be printed out. 0:trace, 1:debug, 2:info, 3:warning, 4:error, 5:fatal");
     def->min = 0;
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && defined(SLIC3R_GUI)
     def = this->add("sw_renderer", coBool);
     def->label = L("Render with a software renderer");
     def->tooltip = L("Render with a software renderer. The bundled MESA software renderer is loaded instead of the default OpenGL driver.");

From 4abcf7bec41ac89b26b7bf0aaea969d2a475a94e Mon Sep 17 00:00:00 2001
From: Lukas Matena <lukasmatena@seznam.cz>
Date: Fri, 12 Apr 2019 14:24:59 +0200
Subject: [PATCH 4/4] SLA gizmo dialog height increased so the new clipping
 plane slider fits

---
 src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp
index 129db2715..04c7e2046 100644
--- a/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp
+++ b/src/slic3r/GUI/Gizmos/GLGizmoSlaSupports.cpp
@@ -771,7 +771,7 @@ void GLGizmoSlaSupports::on_render_input_window(float x, float y, float bottom_l
 RENDER_AGAIN:
     m_imgui->set_next_window_pos(x, y, ImGuiCond_Always);
 
-    const ImVec2 window_size(m_imgui->scaled(17.f, 18.f));
+    const ImVec2 window_size(m_imgui->scaled(17.f, 20.f));
     ImGui::SetNextWindowPos(ImVec2(x, y - std::max(0.f, y+window_size.y-bottom_limit) ));
     ImGui::SetNextWindowSize(ImVec2(window_size));