diff --git a/src/app/app.cpp b/src/app/app.cpp index 6d854a3fd..9c6413629 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -57,6 +57,8 @@ #include "app/util/clipboard.h" #include "base/exception.h" #include "base/fs.h" +#include "base/platform.h" +#include "base/replace_string.h" #include "base/split_string.h" #include "doc/sprite.h" #include "fmt/format.h" @@ -762,9 +764,35 @@ void App::showBackupNotification(bool state) void App::updateDisplayTitleBar() { - std::string defaultTitle = fmt::format("{} v{}", get_app_name(), get_app_version()); + static std::string defaultTitle; std::string title; + if (defaultTitle.empty()) { + defaultTitle = fmt::format("{} v{}", get_app_name(), get_app_version()); + +#if LAF_MACOS + // On macOS we remove the "-arm64" suffix for Apple Silicon as it + // will be the most common platform from now on. + if constexpr (base::Platform::arch == base::Platform::Arch::arm64) { + base::replace_string(defaultTitle, "-arm64", ""); + } + else if constexpr (base::Platform::arch == base::Platform::Arch::x64) { + base::replace_string(defaultTitle, "-x64", ""); + defaultTitle += " (x64)"; + } +#else + // On PC (Windows/Linux) we try to remove "-x64" suffix as it's + // the most common platform. + if constexpr (base::Platform::arch == base::Platform::Arch::x64) { + base::replace_string(defaultTitle, "-x64", ""); + } + else if constexpr (base::Platform::arch == base::Platform::Arch::x86) { + base::replace_string(defaultTitle, "-x86", ""); + defaultTitle += " (x86)"; + } +#endif + } + DocView* docView = UIContext::instance()->activeView(); if (docView) { // Prepend the document's filename.