Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2020-03-13 16:57:45 +0300
committerbubnikv <bubnikv@gmail.com>2020-03-13 16:57:45 +0300
commit98fc01afe77bdb408ecf7142215ce18333176996 (patch)
treeecd2eafe500d3f33e612d851255aa65c35d02602 /src/slic3r/GUI
parent9b26f8a18b214174b9749d7db44f5d57fcd2a6b0 (diff)
Fix of compilation on OSX and Linux, update of camera after 3D mouse
disconnect moved to the main thread.
Diffstat (limited to 'src/slic3r/GUI')
-rw-r--r--src/slic3r/GUI/Mouse3DController.cpp22
-rw-r--r--src/slic3r/GUI/RemovableDriveManager.cpp2
2 files changed, 17 insertions, 7 deletions
diff --git a/src/slic3r/GUI/Mouse3DController.cpp b/src/slic3r/GUI/Mouse3DController.cpp
index 32b6739e6..dcce52ae8 100644
--- a/src/slic3r/GUI/Mouse3DController.cpp
+++ b/src/slic3r/GUI/Mouse3DController.cpp
@@ -407,9 +407,13 @@ void Mouse3DController::disconnected()
m_params_by_device[m_device_str] = m_params_ui;
m_device_str.clear();
m_connected = false;
- wxGetApp().plater()->get_camera().recover_from_free_camera();
- wxGetApp().plater()->set_current_canvas_as_dirty();
- wxWakeUpIdle();
+ wxGetApp().plater()->CallAfter([]() {
+ Plater *plater = wxGetApp().plater();
+ if (plater != nullptr) {
+ plater->get_camera().recover_from_free_camera();
+ plater->set_current_canvas_as_dirty();
+ }
+ });
}
}
@@ -822,10 +826,14 @@ void Mouse3DController::disconnect_device()
#ifdef _WIN32
// Enumerate once immediately after disconnect.
m_wakeup = true;
-#endif // _WIN32
- wxGetApp().plater()->get_camera().recover_from_free_camera();
- wxGetApp().plater()->set_current_canvas_as_dirty();
- wxWakeUpIdle();
+#endif // _WIN32
+ wxGetApp().plater()->CallAfter([]() {
+ Plater *plater = wxGetApp().plater();
+ if (plater != nullptr) {
+ plater->get_camera().recover_from_free_camera();
+ plater->set_current_canvas_as_dirty();
+ }
+ });
}
}
diff --git a/src/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp
index 41f0175eb..17aa60997 100644
--- a/src/slic3r/GUI/RemovableDriveManager.cpp
+++ b/src/slic3r/GUI/RemovableDriveManager.cpp
@@ -440,7 +440,9 @@ void RemovableDriveManager::update()
void RemovableDriveManager::thread_proc()
{
// Signal the worker thread to update initially.
+#ifdef _WIN32
m_wakeup = true;
+#endif // _WIN32
for (;;) {
// Wait for 2 seconds before running the disk enumeration.