diff options
| author | 2019-09-05 12:29:50 +1000 | |
|---|---|---|
| committer | 2019-09-05 12:29:50 +1000 | |
| commit | 953d49810a85107c515eec0100fdb7e1fba528f8 (patch) | |
| tree | f8a6c3d3d6fa860ac7123db5d28cea9889ea7d03 | |
| parent | Merge pull request #2802 from ReinUsesLisp/hsetp2-pred (diff) | |
| parent | Address review comments (diff) | |
| download | yuzu-953d49810a85107c515eec0100fdb7e1fba528f8.tar.gz yuzu-953d49810a85107c515eec0100fdb7e1fba528f8.tar.xz yuzu-953d49810a85107c515eec0100fdb7e1fba528f8.zip | |
Merge pull request #2797 from FearlessTobi/port-4877
Port citra-emu/citra#4877: "citra_qt: on osx chdir to bundle dir to allow detection of user folder"
| -rw-r--r-- | src/yuzu/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 6d249cb3e..8304c6517 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -6,6 +6,9 @@ | |||
| 6 | #include <clocale> | 6 | #include <clocale> |
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <thread> | 8 | #include <thread> |
| 9 | #ifdef __APPLE__ | ||
| 10 | #include <unistd.h> // for chdir | ||
| 11 | #endif | ||
| 9 | 12 | ||
| 10 | // VFS includes must be before glad as they will conflict with Windows file api, which uses defines. | 13 | // VFS includes must be before glad as they will conflict with Windows file api, which uses defines. |
| 11 | #include "applets/error.h" | 14 | #include "applets/error.h" |
| @@ -2226,6 +2229,14 @@ int main(int argc, char* argv[]) { | |||
| 2226 | QCoreApplication::setOrganizationName(QStringLiteral("yuzu team")); | 2229 | QCoreApplication::setOrganizationName(QStringLiteral("yuzu team")); |
| 2227 | QCoreApplication::setApplicationName(QStringLiteral("yuzu")); | 2230 | QCoreApplication::setApplicationName(QStringLiteral("yuzu")); |
| 2228 | 2231 | ||
| 2232 | #ifdef __APPLE__ | ||
| 2233 | // If you start a bundle (binary) on OSX without the Terminal, the working directory is "/". | ||
| 2234 | // But since we require the working directory to be the executable path for the location of the | ||
| 2235 | // user folder in the Qt Frontend, we need to cd into that working directory | ||
| 2236 | const std::string bin_path = FileUtil::GetBundleDirectory() + DIR_SEP + ".."; | ||
| 2237 | chdir(bin_path.c_str()); | ||
| 2238 | #endif | ||
| 2239 | |||
| 2229 | // Enables the core to make the qt created contexts current on std::threads | 2240 | // Enables the core to make the qt created contexts current on std::threads |
| 2230 | QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); | 2241 | QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); |
| 2231 | QApplication app(argc, argv); | 2242 | QApplication app(argc, argv); |