diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-05-23 21:22:43 -0500 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-05-23 21:25:13 -0500 |
| commit | 12ce612e00af99990d364b1b74aca39e81b4d56f (patch) | |
| tree | 6ea4643827ddb60d70d5b9ed4e322e089563c0c5 /src | |
| parent | 5891a5feabdd768a3e649ff6087fac9c42b129cc (diff) | |
Fix native Stardew launch paths
Diffstat (limited to 'src')
| -rw-r--r-- | src/src/moapplication.cpp | 6 | ||||
| -rw-r--r-- | src/src/organizercore.cpp | 4 | ||||
| -rw-r--r-- | src/src/protonlauncher.cpp | 19 | ||||
| -rw-r--r-- | src/src/spawn.cpp | 2 |
4 files changed, 26 insertions, 5 deletions
diff --git a/src/src/moapplication.cpp b/src/src/moapplication.cpp index f130881..94e5b02 100644 --- a/src/src/moapplication.cpp +++ b/src/src/moapplication.cpp @@ -390,9 +390,9 @@ int MOApplication::setup(MOMultiProcess& multiProcess, bool forceSelect) FuseConnector::tryCleanupStaleMount(dataDir); } - // Restore any stale INI/save backups left by a previous crash. This ensures - // the documents directory is clean before we do anything else. - { + // Restore any stale INI/save backups left by a previous Wine/Proton crash. + // Native Linux game instances do not use the prefix during launch. + if (!m_instance->gamePlugin()->isNativeLinux()) { auto prefixPath = FluorineConfig::prefixPath(); if (!prefixPath || prefixPath->isEmpty()) { QSettings const instanceSettings(m_settings->filename(), QSettings::IniFormat); diff --git a/src/src/organizercore.cpp b/src/src/organizercore.cpp index c469033..d3f6cc0 100644 --- a/src/src/organizercore.cpp +++ b/src/src/organizercore.cpp @@ -104,7 +104,9 @@ QStringList toStringList(InputIterator current, InputIterator end) QString resolveWinePrefixPath(const Settings& settings, const IPluginGame* managedGame) { - Q_UNUSED(managedGame); + if (managedGame != nullptr && managedGame->isNativeLinux()) { + return {}; + } if (auto cfg = FluorineConfig::load(); cfg.has_value() && cfg->prefixExists()) { return cfg->prefix_path.trimmed(); diff --git a/src/src/protonlauncher.cpp b/src/src/protonlauncher.cpp index 4e71c55..b4ed15b 100644 --- a/src/src/protonlauncher.cpp +++ b/src/src/protonlauncher.cpp @@ -1062,6 +1062,25 @@ bool ProtonLauncher::launchDirect(qint64& pid) const env.insert(it.key(), it.value()); } + // Native Linux games often ship shared libraries beside the executable. + // QProcess sets the cwd, but the dynamic loader/dlopen will not search it + // unless it is also present in LD_LIBRARY_PATH. + QStringList libraryPaths; + if (!m_workingDir.isEmpty()) { + libraryPaths << QDir::cleanPath(m_workingDir); + } + const QString binaryDir = QFileInfo(m_binary).absolutePath(); + if (!binaryDir.isEmpty() && !libraryPaths.contains(binaryDir)) { + libraryPaths << binaryDir; + } + const QString existingLdLibraryPath = env.value("LD_LIBRARY_PATH"); + if (!existingLdLibraryPath.isEmpty()) { + libraryPaths << existingLdLibraryPath.split(':', Qt::SkipEmptyParts); + } + if (!libraryPaths.isEmpty()) { + env.insert("LD_LIBRARY_PATH", libraryPaths.join(':')); + } + if (m_useTerminal) { wrapInTerminal(program, arguments); } diff --git a/src/src/spawn.cpp b/src/src/spawn.cpp index c6f4691..3163792 100644 --- a/src/src/spawn.cpp +++ b/src/src/spawn.cpp @@ -462,7 +462,7 @@ int spawn(const SpawnParameters& sp, pid_t& processId) launcher.setSavesBindMount(sp.saveBindMountSource, sp.saveBindMountTarget); } } else { - MOBase::log::info("Proton disabled for this executable, launching directly"); + MOBase::log::info("Launching executable directly without Proton"); } launcher.setUseTerminal(sp.useTerminal); |
