From 659891db4f26d52ee58e18c470a45522087bee83 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Sat, 28 Mar 2026 16:32:48 -0500 Subject: Clean bundled library paths before launching winetricks Winetricks spawns kdialog/zenity for its GUI, which inherit Fluorine's LD_LIBRARY_PATH pointing at bundled Qt .so files. On SteamOS (Steam Deck) this causes symbol lookup errors in the system kdialog. Restore the original host library paths from FLUORINE_ORIG_* env vars before launching winetricks. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/src/settingsdialogproton.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src') diff --git a/src/src/settingsdialogproton.cpp b/src/src/settingsdialogproton.cpp index bd14944..96906fa 100644 --- a/src/src/settingsdialogproton.cpp +++ b/src/src/settingsdialogproton.cpp @@ -467,6 +467,25 @@ void ProtonSettingsTab::onWinetricks() arguments << QStringLiteral("--gui"); QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); + + // 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) { + if (env.contains(origVar)) { + const QString orig = env.value(origVar); + if (orig.isEmpty()) + env.remove(var); + else + env.insert(var, orig); + env.remove(origVar); + } + }; + 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"); + env.remove("QT_QPA_PLATFORM_PLUGIN_PATH"); + for (const QString& flag : envFlags) { const int eq = flag.indexOf('='); if (eq > 0) { -- cgit v1.3.1