Path: blob/main/cad/OrcaSlicer/files/patch-src_slic3r_GUI_GUI__App.cpp
34610 views
--- src/slic3r/GUI/GUI_App.cpp.orig 2025-10-02 17:32:12 UTC1+++ src/slic3r/GUI/GUI_App.cpp2@@ -468,7 +468,7 @@ class SplashScreen : public wxSplashScreen (private)3m_constant_text;4};56-#ifdef __linux__7+#if defined(__linux__) || defined(__FreeBSD__)8bool static check_old_linux_datadir(const wxString& app_name) {9// If we are on Linux and the datadir does not exist yet, look into the old10// location where the datadir was before version 2.3. If we find it there,11@@ -886,6 +886,7 @@ void GUI_App::post_init()12}13else {14BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << "Found glcontext not ready, postpone the init";15+ plater_->canvas3D()->enable_render(true);16}17//#endif18if (is_editor())19@@ -1905,7 +1906,7 @@ bool GUI_App::init_opengl()2021bool GUI_App::init_opengl()22{23-#ifdef __linux__24+#if defined(__linux__) || defined(__FreeBSD__)25bool status = m_opengl_mgr.init_gl();26m_opengl_initialized = true;27return status;28@@ -1997,7 +1998,7 @@ void GUI_App::init_app_config()29}30else{31boost::filesystem::path data_dir_path;32- #ifndef __linux__33+ #if !defined(__linux__) && !defined(__FreeBSD__)34std::string data_dir = wxStandardPaths::Get().GetUserDataDir().ToUTF8().data();35//BBS create folder if not exists36data_dir_path = boost::filesystem::path(data_dir);37@@ -2097,7 +2098,7 @@ std::map<std::string, std::string> GUI_App::get_extra_38#endif39#elif defined(__APPLE__)40extra_headers.insert(std::make_pair("X-BBL-OS-Type", "macos"));41-#elif defined(__LINUX__)42+#elif defined(__LINUX__) || defined(__FreeBSD__)43extra_headers.insert(std::make_pair("X-BBL-OS-Type", "linux"));44#endif45int major = 0, minor = 0, micro = 0;46@@ -2298,7 +2299,7 @@ bool GUI_App::on_init_inner()47wxCHECK_MSG(wxDirExists(resources_dir), false,48wxString::Format(_L("Resources path does not exist or is not a directory: %s"), resources_dir));4950-#ifdef __linux__51+#if defined(__linux__) || defined(__FreeBSD__)52if (! check_old_linux_datadir(GetAppName())) {53std::cerr << "Quitting, user chose to move their data to new location." << std::endl;54return false;55@@ -2443,7 +2444,7 @@ bool GUI_App::on_init_inner()5657BOOST_LOG_TRIVIAL(info) << "begin to show the splash screen...";58//BBS use BBL splashScreen59- scrn = new SplashScreen(bmp, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_TIMEOUT, 1500, splashscreen_pos);60+ scrn = new SplashScreen(bmp, wxSPLASH_CENTRE_ON_SCREEN, 0, splashscreen_pos);61wxYield();62scrn->SetText(_L("Loading configuration")+ dots);63}64@@ -2676,6 +2677,11 @@ bool GUI_App::on_init_inner()65mainframe->Show(true);66BOOST_LOG_TRIVIAL(info) << "main frame firstly shown";6768+ if (scrn) {69+ scrn->Close();70+ scrn = nullptr;71+ }72+73//#if BBL_HAS_FIRST_PAGE74//BBS: set tp3DEditor firstly75/*plater_->canvas3D()->enable_render(false);76@@ -3014,7 +3020,7 @@ void GUI_App::init_label_colours()77m_color_label_modified = is_dark_mode ? wxColour("#F1754E") : wxColour("#F1754E");78m_color_label_sys = is_dark_mode ? wxColour("#B2B3B5") : wxColour("#363636");7980-#if defined(_WIN32) || defined(__linux__) || defined(__APPLE__)81+#if defined(_WIN32) || defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)82m_color_label_default = is_dark_mode ? wxColour(250, 250, 250) : m_color_label_sys; // wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);83m_color_highlight_label_default = is_dark_mode ? wxColour(230, 230, 230): wxSystemSettings::GetColour(/*wxSYS_COLOUR_HIGHLIGHTTEXT*/wxSYS_COLOUR_WINDOWTEXT);84m_color_highlight_default = is_dark_mode ? wxColour("#36363B") : wxColour("#F1F1F1"); // ORCA row highlighting85@@ -4322,7 +4328,7 @@ void GUI_App::check_new_version(bool show_tips, int by86#ifdef __APPLE__87platform = "macos";88#endif89-#ifdef __LINUX__90+#if defined(__LINUX__) || defined(__FreeBSD__)91platform = "linux";92#endif93std::string query_params = (boost::format("?name=slicer&version=%1%&guide_version=%2%")94@@ -4405,7 +4411,7 @@ std::string detect_updater_os()95return "win";96#elif defined(__APPLE__)97return "macos";98-#elif defined(__linux__) || defined(__LINUX__)99+#elif defined(__linux__) || defined(__LINUX__) || defined(__FreeBSD__)100return "linux";101#else102return "unknown";103@@ -5337,7 +5343,7 @@ bool GUI_App::switch_language()104}105}106107-#ifdef __linux__108+#if defined(__linux__) || defined(__FreeBSD__)109static const wxLanguageInfo* linux_get_existing_locale_language(const wxLanguageInfo* language,110const wxLanguageInfo* system_language)111{112@@ -5542,7 +5548,7 @@ bool GUI_App::load_language(wxString language, bool in113m_language_info_best->CanonicalName.ToUTF8().data();114app_config->set("language", m_language_info_best->CanonicalName.ToUTF8().data());115}116-#ifdef __linux__117+#if defined(__linux__) || defined(__FreeBSD__)118wxString lc_all;119if (wxGetEnv("LC_ALL", &lc_all) && !lc_all.IsEmpty()) {120// Best language returned by wxWidgets on Linux apparently does not respect LC_ALL.121@@ -5597,7 +5603,7 @@ bool GUI_App::load_language(wxString language, bool in122BOOST_LOG_TRIVIAL(info) << "Using Czech dictionaries for Slovak language";123}124125-#ifdef __linux__126+#if defined(__linux__) || defined(__FreeBSD__)127// If we can't find this locale , try to use different one for the language128// instead of just reporting that it is impossible to switch.129if (! wxLocale::IsAvailable(language_info->Language) && m_language_info_system) {130@@ -6725,7 +6731,7 @@ void GUI_App::show_desktop_integration_dialog()131132void GUI_App::show_desktop_integration_dialog()133{134-#ifdef __linux__135+#if defined(__linux__) || defined(__FreeBSD__)136//wxCHECK_MSG(mainframe != nullptr, false, "Internal error: Main frame not created / null");137DesktopIntegrationDialog dialog(mainframe);138dialog.ShowModal();139@@ -7100,7 +7106,7 @@ void GUI_App::associate_url(std::wstring url_prefix)140key_full.Create(false);141}142key_full = key_string;143-#elif defined(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION)144+#elif (defined(__linux__) || defined(__FreeBSD__)) && defined(SLIC3R_DESKTOP_INTEGRATION)145DesktopIntegrationDialog::perform_downloader_desktop_integration(into_u8(url_prefix));146#endif // WIN32147}148149150