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-09 12:56:51 +0300
committerbubnikv <bubnikv@gmail.com>2020-03-09 12:56:51 +0300
commite83fb4582c1de8477fd10d8675e3b0a1e5ef9767 (patch)
treeacbf829cf19c3928eea35f764879ddcdda5bf24a /src/slic3r/GUI/RemovableDriveManager.cpp
parentec75b760b8e7277ed90f0e4cd7113190db4607bf (diff)
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)
Diffstat (limited to 'src/slic3r/GUI/RemovableDriveManager.cpp')
-rw-r--r--src/slic3r/GUI/RemovableDriveManager.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp
index 2264cc954..5054d061e 100644
--- a/src/slic3r/GUI/RemovableDriveManager.cpp
+++ b/src/slic3r/GUI/RemovableDriveManager.cpp
@@ -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));