mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 05:37:52 -06:00
Reworked the eject on unix systems to wait for the return of the
system call to the command line utility and send out the unmount wxWidgets event immediately. Hopefully improves 2.2.0-RC Eject is very slow in Linux (#3795)
This commit is contained in:
parent
ec75b760b8
commit
e83fb4582c
2 changed files with 12 additions and 2 deletions
|
@ -348,7 +348,10 @@ void RemovableDriveManager::eject_drive()
|
|||
return;
|
||||
}
|
||||
|
||||
m_drive_data_last_eject = *it_drive_data;
|
||||
assert(m_callback_evt_handler);
|
||||
if (m_callback_evt_handler)
|
||||
wxPostEvent(m_callback_evt_handler, RemovableDriveEjectEvent(EVT_REMOVABLE_DRIVE_EJECTED, std::move(*it_drive_data)));
|
||||
m_current_drives.erase(it_drive_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -473,12 +476,15 @@ void RemovableDriveManager::update()
|
|||
tbb::mutex::scoped_lock lock(m_drives_mutex);
|
||||
std::sort(current_drives.begin(), current_drives.end());
|
||||
if (current_drives != m_current_drives) {
|
||||
#ifdef WIN32
|
||||
if (! m_drive_data_last_eject.empty() && std::find(current_drives.begin(), current_drives.end(), m_drive_data_last_eject) == current_drives.end()) {
|
||||
assert(m_callback_evt_handler);
|
||||
if (m_callback_evt_handler)
|
||||
wxPostEvent(m_callback_evt_handler, RemovableDriveEjectEvent(EVT_REMOVABLE_DRIVE_EJECTED, std::move(m_drive_data_last_eject)));
|
||||
m_drive_data_last_eject.clear();
|
||||
} else {
|
||||
} else
|
||||
#endif // WIN32
|
||||
{
|
||||
assert(m_callback_evt_handler);
|
||||
if (m_callback_evt_handler)
|
||||
wxPostEvent(m_callback_evt_handler, RemovableDrivesChangedEvent(EVT_REMOVABLE_DRIVES_CHANGED));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue