diff --git a/src/citra_qt/citra_qt.cpp b/src/citra_qt/citra_qt.cpp index 242fab411..f0aba2c31 100644 --- a/src/citra_qt/citra_qt.cpp +++ b/src/citra_qt/citra_qt.cpp @@ -116,6 +116,7 @@ #ifdef __APPLE__ #include "common/apple_authorization.h" +#include "common/apple_utils.h" Q_IMPORT_PLUGIN(QDarwinCameraPermissionPlugin); #endif @@ -424,6 +425,19 @@ GMainWindow::GMainWindow(Core::System& system_) show(); +#ifdef __APPLE__ + if (AppleUtils::IsRunningFromTerminal()) { + QMessageBox::warning( + this, tr("Warning"), + tr("The `azahar` executable is being run directly rather than via the Azahar.app " + "bundle.\n\n" + "When run this way, the app may be missing certain functionality such as camera " + "emulation.\n\n" + "It is recommended to instead run Azahar using the `open` command, e.g.:\n" + "`open ./Azahar.app`")); + } +#endif + #ifdef ENABLE_QT_UPDATE_CHECKER if (UISettings::values.check_for_update_on_start) { update_future = QtConcurrent::run([]() -> QString { diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index d6bdd1599..4b6e74c49 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -120,6 +120,7 @@ if (APPLE AND NOT ENABLE_LIBRETRO) target_sources(citra_common PUBLIC apple_authorization.h apple_authorization.cpp + apple_utils.cpp apple_utils.h apple_utils.mm ) diff --git a/src/common/apple_utils.cpp b/src/common/apple_utils.cpp new file mode 100644 index 000000000..e72613dd3 --- /dev/null +++ b/src/common/apple_utils.cpp @@ -0,0 +1,13 @@ +// Copyright Citra Emulator Project / Azahar Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include + +namespace AppleUtils { + +bool IsRunningFromTerminal() { + return (getppid() != 1); +} + +} // namespace AppleUtils diff --git a/src/common/apple_utils.h b/src/common/apple_utils.h index 4354fbaa3..66e2b428b 100644 --- a/src/common/apple_utils.h +++ b/src/common/apple_utils.h @@ -6,5 +6,6 @@ namespace AppleUtils { float GetRefreshRate(); int IsLowPowerModeEnabled(); +bool IsRunningFromTerminal(); } // namespace AppleUtils