2022-04-02 18:59:03 +00:00
|
|
|
commit d4c899cede0743d40934ca11f83691cda72ff9dd
|
|
|
|
Author: Carles Pastor <cpbadosa@gmail.com>
|
|
|
|
Date: Sat Apr 2 20:47:06 2022 +0200
|
|
|
|
|
|
|
|
Detect when running inside a flatpak sandbox
|
|
|
|
|
2022-04-01 15:34:16 +00:00
|
|
|
diff --git a/Source/Core/UICommon/UICommon.cpp b/Source/Core/UICommon/UICommon.cpp
|
2022-04-02 18:59:03 +00:00
|
|
|
index cb857fd3c7..e3ddde24fb 100644
|
2022-04-01 15:34:16 +00:00
|
|
|
--- a/Source/Core/UICommon/UICommon.cpp
|
|
|
|
+++ b/Source/Core/UICommon/UICommon.cpp
|
2022-04-02 18:59:03 +00:00
|
|
|
@@ -309,24 +309,25 @@ void SetUserDirectory(std::string custom_path)
|
|
|
|
// We are on a non-Apple and non-Android POSIX system, there are 4 cases:
|
|
|
|
// 1. GetExeDirectory()/portable.txt exists
|
2022-04-01 15:34:16 +00:00
|
|
|
// -> Use GetExeDirectory()/User
|
|
|
|
- // 2. $DOLPHIN_EMU_USERPATH is set
|
2022-04-02 18:59:03 +00:00
|
|
|
+ // 2. $DOLPHIN_EMU_USERPATH is set, and we're not in flatpak
|
2022-04-01 15:34:16 +00:00
|
|
|
// -> Use $DOLPHIN_EMU_USERPATH
|
|
|
|
- // 3. ~/.dolphin-emu directory exists
|
2022-04-02 18:59:03 +00:00
|
|
|
+ // 3. ~/.dolphin-emu directory exists, and we're not in flatpak
|
2022-04-01 15:34:16 +00:00
|
|
|
// -> Use ~/.dolphin-emu
|
2022-04-02 18:59:03 +00:00
|
|
|
// 4. Default
|
2022-04-01 15:34:16 +00:00
|
|
|
// -> Use XDG basedir, see
|
|
|
|
// http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
|
|
|
user_path = home_path + "." DOLPHIN_DATA_DIR DIR_SEP;
|
|
|
|
std::string exe_path = File::GetExeDirectory();
|
2022-04-02 18:59:03 +00:00
|
|
|
+ bool flatpak = File::Exists("/.flatpak-info");
|
|
|
|
if (File::Exists(exe_path + DIR_SEP "portable.txt"))
|
2022-04-01 15:34:16 +00:00
|
|
|
{
|
|
|
|
user_path = exe_path + DIR_SEP "User" DIR_SEP;
|
|
|
|
}
|
2022-04-02 18:59:03 +00:00
|
|
|
- else if (env_path)
|
|
|
|
+ else if (env_path && !flatpak)
|
|
|
|
{
|
|
|
|
user_path = env_path;
|
|
|
|
}
|
|
|
|
- else if (!File::Exists(user_path))
|
|
|
|
+ else if (flatpak || !File::Exists(user_path))
|
|
|
|
{
|
|
|
|
const char* data_home = getenv("XDG_DATA_HOME");
|
|
|
|
std::string data_path =
|