From 50d5566021badb77582da7fe501ba1902a8786ab Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Tue, 31 Mar 2026 12:56:24 -0500 Subject: Fix zenity symbol lookup errors when launching winetricks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The restoreOrig lambda only restored env vars when FLUORINE_ORIG_* was set, with no fallback. If those vars were missing, bundled library paths leaked into winetricks/zenity causing FcConfigSetDefaultSubstitute symbol errors. Now uses the same restoreOrStrip pattern as protonlauncher.cpp — strip paths containing "fluorine" as fallback. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/src/settingsdialogproton.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/src/settingsdialogproton.cpp b/src/src/settingsdialogproton.cpp index 96906fa..5efc7c6 100644 --- a/src/src/settingsdialogproton.cpp +++ b/src/src/settingsdialogproton.cpp @@ -470,8 +470,9 @@ void ProtonSettingsTab::onWinetricks() // Restore the original host LD_LIBRARY_PATH so that winetricks (and any // GUI helpers it spawns, e.g. kdialog/zenity) don't pick up Fluorine's - // bundled Qt libraries, which cause symbol-lookup errors on SteamOS. - auto restoreOrig = [&](const QString& var, const QString& origVar) { + // bundled Qt libraries, which cause symbol-lookup errors. + // Uses the same restore-or-strip logic as protonlauncher.cpp. + auto restoreOrStrip = [&](const QString& var, const QString& origVar) { if (env.contains(origVar)) { const QString orig = env.value(origVar); if (orig.isEmpty()) @@ -479,11 +480,27 @@ void ProtonSettingsTab::onWinetricks() else env.insert(var, orig); env.remove(origVar); + } else { + // Fallback: strip Fluorine's bundled library paths by pattern. + const QString value = env.value(var); + if (value.isEmpty()) return; + QStringList kept; + for (const QString& p : value.split(':')) { + if (p.contains("fluorine") || p.contains(".mount_Fluori")) { + continue; + } + kept.append(p); + } + if (kept.isEmpty()) { + env.remove(var); + } else { + env.insert(var, kept.join(':')); + } } }; - restoreOrig("LD_LIBRARY_PATH", "FLUORINE_ORIG_LD_LIBRARY_PATH"); - restoreOrig("LD_PRELOAD", "FLUORINE_ORIG_LD_PRELOAD"); - restoreOrig("QT_PLUGIN_PATH", "FLUORINE_ORIG_QT_PLUGIN_PATH"); + restoreOrStrip("LD_LIBRARY_PATH", "FLUORINE_ORIG_LD_LIBRARY_PATH"); + restoreOrStrip("LD_PRELOAD", "FLUORINE_ORIG_LD_PRELOAD"); + restoreOrStrip("QT_PLUGIN_PATH", "FLUORINE_ORIG_QT_PLUGIN_PATH"); env.remove("QT_QPA_PLATFORM_PLUGIN_PATH"); for (const QString& flag : envFlags) { -- cgit v1.3.1