mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 00:37:51 -06:00
Fix of saving the 3DConnexion status on OSX.
Fixes 2.2.0 RC2 - 3Dconnexion settings not saved / Zoom digital (#3791)
This commit is contained in:
parent
6723b5f3cd
commit
ec75b760b8
2 changed files with 10 additions and 4 deletions
|
@ -368,6 +368,8 @@ void Mouse3DController::render_settings_dialog(GLCanvas3D& canvas) const
|
||||||
|
|
||||||
void Mouse3DController::connected(std::string device_name)
|
void Mouse3DController::connected(std::string device_name)
|
||||||
{
|
{
|
||||||
|
assert(! m_connected);
|
||||||
|
assert(m_device_str.empty());
|
||||||
m_device_str = device_name;
|
m_device_str = device_name;
|
||||||
// Copy the parameters for m_device_str into the current parameters.
|
// Copy the parameters for m_device_str into the current parameters.
|
||||||
if (auto it_params = m_params_by_device.find(m_device_str); it_params != m_params_by_device.end()) {
|
if (auto it_params = m_params_by_device.find(m_device_str); it_params != m_params_by_device.end()) {
|
||||||
|
@ -380,13 +382,13 @@ void Mouse3DController::connected(std::string device_name)
|
||||||
void Mouse3DController::disconnected()
|
void Mouse3DController::disconnected()
|
||||||
{
|
{
|
||||||
// Copy the current parameters for m_device_str into the parameter database.
|
// Copy the current parameters for m_device_str into the parameter database.
|
||||||
assert(! m_device_str.empty());
|
assert(m_connected == ! m_device_str.empty());
|
||||||
if (! m_device_str.empty()) {
|
if (m_connected) {
|
||||||
tbb::mutex::scoped_lock lock(m_params_ui_mutex);
|
tbb::mutex::scoped_lock lock(m_params_ui_mutex);
|
||||||
m_params_by_device[m_device_str] = m_params_ui;
|
m_params_by_device[m_device_str] = m_params_ui;
|
||||||
|
m_device_str.clear();
|
||||||
|
m_connected = false;
|
||||||
}
|
}
|
||||||
m_device_str.clear();
|
|
||||||
m_connected = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mouse3DController::handle_input(const DataPacketAxis& packet)
|
bool Mouse3DController::handle_input(const DataPacketAxis& packet)
|
||||||
|
|
|
@ -152,6 +152,8 @@ static void DeviceAdded(uint32_t unused)
|
||||||
static void DeviceRemoved(uint32_t unused)
|
static void DeviceRemoved(uint32_t unused)
|
||||||
{
|
{
|
||||||
BOOST_LOG_TRIVIAL(info) << "3dx device removed\n";
|
BOOST_LOG_TRIVIAL(info) << "3dx device removed\n";
|
||||||
|
assert(m_connected);
|
||||||
|
assert(! m_device_str.empty());
|
||||||
mouse_3d_controller->disconnected();
|
mouse_3d_controller->disconnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,6 +216,8 @@ void Mouse3DController::shutdown()
|
||||||
CleanupConnexionHandlers();
|
CleanupConnexionHandlers();
|
||||||
unload_driver();
|
unload_driver();
|
||||||
}
|
}
|
||||||
|
// Copy the current parameters to parameter database, mark the device as disconnected.
|
||||||
|
this->disconnected();
|
||||||
mouse_3d_controller = nullptr;
|
mouse_3d_controller = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue