Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/libslic3r/MacUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions src/libslic3r/MacUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 17 additions & 8 deletions src/slic3r/GUI/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
#include "Widgets/ProgressDialog.hpp"
#include "BindDialog.hpp"
#include "../Utils/MacDarkMode.hpp"
#ifdef __APPLE__
#include "libslic3r/MacUtils.hpp"
#endif

#include <fstream>
#include <string_view>
Expand Down Expand Up @@ -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<BambuStudioTaskBarIcon>(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<BambuStudioTaskBarIcon>(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__

Expand Down