diff --git a/src/libslic3r/MacUtils.hpp b/src/libslic3r/MacUtils.hpp index 29366ee3f7..de69579962 100644 --- a/src/libslic3r/MacUtils.hpp +++ b/src/libslic3r/MacUtils.hpp @@ -5,6 +5,9 @@ namespace Slic3r { bool is_macos_support_boost_add_file_log(); int is_mac_version_15(); + +// Returns true when running on macOS `major` or any later version. +bool is_mac_os_at_least(int major); } #endif diff --git a/src/libslic3r/MacUtils.mm b/src/libslic3r/MacUtils.mm index f5fa82fe35..3314d2856d 100644 --- a/src/libslic3r/MacUtils.mm +++ b/src/libslic3r/MacUtils.mm @@ -20,4 +20,12 @@ int is_mac_version_15() return false; } } + +// Runtime check that works regardless of the SDK used to build, and is +// inherently true for the given major version and all later ones. +bool is_mac_os_at_least(int major) +{ + NSOperatingSystemVersion version = { major, 0, 0 }; + return [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:version]; +} }; // namespace Slic3r diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 9da8cff1f9..c50d1e2890 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -47,6 +47,9 @@ #include "Widgets/ProgressDialog.hpp" #include "BindDialog.hpp" #include "../Utils/MacDarkMode.hpp" +#ifdef __APPLE__ +#include "libslic3r/MacUtils.hpp" +#endif #include #include @@ -303,14 +306,20 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_ #ifdef __APPLE__ // Initialize the docker task bar icon. - switch (wxGetApp().get_app_mode()) { - default: - case GUI_App::EAppMode::Editor: - m_taskbar_icon = std::make_unique(wxTBI_DOCK); - m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("BambuStudio-mac_256px.ico"), wxBITMAP_TYPE_ICO), "BambuStudio"); - break; - case GUI_App::EAppMode::GCodeViewer: - break; + // On macOS 26+ (Tahoe) setting a custom dock icon at runtime overrides the + // system's Liquid Glass / tinted icon theming for the app bundle icon. Skip + // it there so the themed bundle icon (Icon.icns) is shown instead. The check + // is a lower bound, so future macOS releases (27+) are covered as well. + if (!is_mac_os_at_least(26)) { + switch (wxGetApp().get_app_mode()) { + default: + case GUI_App::EAppMode::Editor: + m_taskbar_icon = std::make_unique(wxTBI_DOCK); + m_taskbar_icon->SetIcon(wxIcon(Slic3r::var("BambuStudio-mac_256px.ico"), wxBITMAP_TYPE_ICO), "BambuStudio"); + break; + case GUI_App::EAppMode::GCodeViewer: + break; + } } #endif // __APPLE__