Fix of compilation on OSX and Linux, update of camera after 3D mouse

disconnect moved to the main thread.
This commit is contained in:
bubnikv 2020-03-13 14:57:45 +01:00
parent 9b26f8a18b
commit 98fc01afe7
2 changed files with 17 additions and 7 deletions

View file

@ -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();
}
});
}
}
@ -823,9 +827,13 @@ void Mouse3DController::disconnect_device()
// 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();
wxGetApp().plater()->CallAfter([]() {
Plater *plater = wxGetApp().plater();
if (plater != nullptr) {
plater->get_camera().recover_from_free_camera();
plater->set_current_canvas_as_dirty();
}
});
}
}

View file

@ -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.