mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-29 11:41:20 -06:00
Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_splitted_vbuffer
This commit is contained in:
commit
250adabd5c
15 changed files with 704 additions and 99 deletions
|
|
@ -611,7 +611,7 @@ struct _3DScene
|
|||
static void point3_to_verts(const Vec3crd& point, double width, double height, GLVolume& volume);
|
||||
};
|
||||
|
||||
static constexpr float BedEpsilon = float(EPSILON);
|
||||
static constexpr float BedEpsilon = 3.f * float(EPSILON);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ void Preview::reload_print(bool keep_volumes)
|
|||
m_volumes_cleanup_required = !keep_volumes;
|
||||
return;
|
||||
}
|
||||
#endif /* __linux __ */
|
||||
#endif /* __linux__ */
|
||||
if (
|
||||
#ifdef __linux__
|
||||
m_volumes_cleanup_required ||
|
||||
|
|
|
|||
|
|
@ -252,14 +252,31 @@ namespace instance_check_internal
|
|||
|
||||
bool instance_check(int argc, char** argv, bool app_config_single_instance)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
boost::system::error_code ec;
|
||||
#endif
|
||||
std::size_t hashed_path =
|
||||
std::size_t hashed_path;
|
||||
#ifdef _WIN32
|
||||
std::hash<std::string>{}(boost::filesystem::system_complete(argv[0]).string());
|
||||
hashed_path = std::hash<std::string>{}(boost::filesystem::system_complete(argv[0]).string());
|
||||
#else
|
||||
std::hash<std::string>{}(boost::filesystem::canonical(boost::filesystem::system_complete(argv[0]), ec).string());
|
||||
boost::system::error_code ec;
|
||||
#ifdef __linux__
|
||||
// If executed by an AppImage, start the AppImage, not the main process.
|
||||
// see https://docs.appimage.org/packaging-guide/environment-variables.html#id2
|
||||
const char *appimage_env = std::getenv("APPIMAGE");
|
||||
bool appimage_env_valid = false;
|
||||
if (appimage_env) {
|
||||
try {
|
||||
auto appimage_path = boost::filesystem::canonical(boost::filesystem::path(appimage_env));
|
||||
if (boost::filesystem::exists(appimage_path)) {
|
||||
hashed_path = std::hash<std::string>{}(appimage_path.string());
|
||||
appimage_env_valid = true;
|
||||
}
|
||||
} catch (std::exception &) {
|
||||
}
|
||||
if (! appimage_env_valid)
|
||||
BOOST_LOG_TRIVIAL(error) << "APPIMAGE environment variable was set, but it does not point to a valid file: " << appimage_env;
|
||||
}
|
||||
if (! appimage_env_valid)
|
||||
#endif // __linux__
|
||||
hashed_path = std::hash<std::string>{}(boost::filesystem::canonical(boost::filesystem::system_complete(argv[0]), ec).string());
|
||||
if (ec.value() > 0) { // canonical was not able to find the executable (can happen with appimage on some systems. Does it fail on Fuse file systems?)
|
||||
ec.clear();
|
||||
// Compose path with boost canonical of folder and filename
|
||||
|
|
@ -269,7 +286,7 @@ bool instance_check(int argc, char** argv, bool app_config_single_instance)
|
|||
hashed_path = std::hash<std::string>{}(boost::filesystem::system_complete(argv[0]).string());
|
||||
}
|
||||
}
|
||||
#endif // win32
|
||||
#endif // _WIN32
|
||||
|
||||
std::string lock_name = std::to_string(hashed_path);
|
||||
GUI::wxGetApp().set_instance_hash(hashed_path);
|
||||
|
|
|
|||
|
|
@ -309,6 +309,13 @@ void Tab::create_preset_tab()
|
|||
// This helps to process all the cursor key events on Windows in the tree control,
|
||||
// so that the cursor jumps to the last item.
|
||||
m_treectrl->Bind(wxEVT_TREE_SEL_CHANGED, [this](wxTreeEvent&) {
|
||||
#ifdef __linux__
|
||||
// Events queue is opposite On Linux. wxEVT_SET_FOCUS invokes after wxEVT_TREE_SEL_CHANGED,
|
||||
// and a result wxEVT_KILL_FOCUS doesn't invoke for the TextCtrls.
|
||||
// see https://github.com/prusa3d/PrusaSlicer/issues/5720
|
||||
// So, call SetFocus explicitly for this control before changing of the selection
|
||||
m_treectrl->SetFocus();
|
||||
#endif
|
||||
if (!m_disable_tree_sel_changed_event && !m_pages.empty()) {
|
||||
if (m_page_switch_running)
|
||||
m_page_switch_planned = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue