From 7bef0188af919f64a5197c31767e767e396b599f Mon Sep 17 00:00:00 2001 From: Carles Pastor Date: Sun, 28 Aug 2022 11:56:48 +0200 Subject: [PATCH] Detect when running inside a flatpak sandbox --- Source/Core/UICommon/UICommon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/UICommon/UICommon.cpp b/Source/Core/UICommon/UICommon.cpp index 4575498fb5..1783536651 100644 --- a/Source/Core/UICommon/UICommon.cpp +++ b/Source/Core/UICommon/UICommon.cpp @@ -424,7 +424,7 @@ void SetUserDirectory(std::string custom_path) // -> Use GetExeDirectory()/User // 2. $DOLPHIN_EMU_USERPATH is set // -> Use $DOLPHIN_EMU_USERPATH - // 3. ~/.dolphin-emu directory exists + // 3. ~/.dolphin-emu directory exists, and we're not in flatpak // -> Use ~/.dolphin-emu // 4. Default // -> Use XDG basedir, see @@ -457,7 +457,7 @@ void SetUserDirectory(std::string custom_path) { user_path = home_path + "." NORMAL_USER_DIR DIR_SEP; - if (!File::Exists(user_path)) + if (File::Exists("/.flatpak-info") || !File::Exists(user_path)) { const char* data_home = getenv("XDG_DATA_HOME"); std::string data_path =