aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-03-16 08:43:40 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-03-16 08:43:40 -0500
commitd7f4ef89b50861696a6fc2d74d29aabbed8c391b (patch)
tree2f4290cddb836e19cfc28a91e0085e0433bb8e37 /src
parentda42b4ddbc1856ab6e3a68ea0727e685020fee4e (diff)
Fix stale symlink check in ensureBundledPluginsLinked for /var/home distros
On Bazzite (and other Fedora immutable distros), /home/ is a symlink to /var/home/. This caused the symlink staleness check to always fail when desktop mode and game mode resolved $HOME differently, deleting and re-creating plugin symlinks on every game-mode launch. If re-creation failed (e.g. race or gamescope restriction), libbasic_games.so would be missing from the per-instance plugin dir, producing the "game plugin 'Oblivion Remastered' doesn't exist" (PluginGone) error. Fix: use canonicalFilePath() on both sides of the comparison so paths that differ only by symlink component (/home/ vs /var/home/) compare equal. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src')
-rw-r--r--src/src/plugincontainer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/src/plugincontainer.cpp b/src/src/plugincontainer.cpp
index aa11f6c..c7e39e9 100644
--- a/src/src/plugincontainer.cpp
+++ b/src/src/plugincontainer.cpp
@@ -40,7 +40,13 @@ static void ensureBundledPluginsLinked(const QString& bundledDir,
if (targetInfo.isSymLink()) {
// Already a symlink — check if it points to the right place.
- if (targetInfo.symLinkTarget() == QFileInfo(it.filePath()).absoluteFilePath()) {
+ // Use canonicalFilePath() on both sides so /home/ ↔ /var/home/ symlinks
+ // (Bazzite/Fedora immutable distros) don't cause false stale-symlink
+ // replacements that can delete the .so before re-linking it.
+ const QString existingTarget =
+ QFileInfo(targetInfo.symLinkTarget()).canonicalFilePath();
+ const QString expectedTarget = QFileInfo(it.filePath()).canonicalFilePath();
+ if (!expectedTarget.isEmpty() && existingTarget == expectedTarget) {
continue; // correct symlink, nothing to do
}
// Stale symlink pointing elsewhere — replace it.