From 066391fb5995376449bf35029650e5543010c983 Mon Sep 17 00:00:00 2001 From: Marco Rodolfi Date: Sun, 9 Feb 2025 14:07:34 +0100 Subject: [PATCH] [main ui] Properly handle XDG format specifications for Linux systems. The issue was stemming from the fact that by default Xenia is running in portable mode, as in use the same root directory as the executable for its datafiles. This default is an issue when using this software from a POSIX platform, since a lot of the times the location where the binary resides is not writable by default. Therefore, force portable mode to be disabled on non Windows platforms. --- src/xenia/app/xenia_main.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/xenia/app/xenia_main.cc b/src/xenia/app/xenia_main.cc index d90246936..25fba3735 100644 --- a/src/xenia/app/xenia_main.cc +++ b/src/xenia/app/xenia_main.cc @@ -95,9 +95,15 @@ UPDATE_from_bool(mount_cache, 2024, 8, 31, 20, false); DEFINE_transient_path(target, "", "Specifies the target .xex or .iso to execute.", "General"); +#ifndef XE_PLATFORM_WIN32 +DEFINE_transient_bool(portable, false, + "Specifies if Xenia should run in portable mode.", + "General"); +#else DEFINE_transient_bool(portable, true, "Specifies if Xenia should run in portable mode.", "General"); +#endif DECLARE_bool(debug); @@ -421,7 +427,7 @@ bool EmulatorApp::OnInitialize() { if (!cvars::portable && !std::filesystem::exists(storage_root / "portable.txt")) { storage_root = xe::filesystem::GetUserFolder(); -#if defined(XE_PLATFORM_WIN32) || defined(XE_PLATFORM_GNU_LINUX) +#if defined(XE_PLATFORM_WIN32) || defined(XE_PLATFORM_LINUX) storage_root = storage_root / "Xenia"; #else // TODO(Triang3l): Point to the app's external storage "files" directory