diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-10-28 07:45:16 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-10-28 07:45:44 +0100 |
commit | 69c9a4136d2decc10f97ad49189070d8e4708110 (patch) | |
tree | b4886667df3187e27d40f358217e0632da5bb9c7 | |
parent | 2f07cc9958f31e405db7498989e90755234c7c47 (diff) |
proto/wine: implement more proton knobs
Reported by: @jp7677
Issue: #996
-rw-r--r-- | proto-wine/ftnoir_protocol_wine.cpp | 15 | ||||
-rw-r--r-- | proto-wine/ftnoir_protocol_wine.h | 5 | ||||
-rw-r--r-- | proto-wine/ftnoir_protocol_wine_dialog.cpp | 3 | ||||
-rw-r--r-- | proto-wine/ftnoir_winecontrols.ui | 55 | ||||
-rw-r--r-- | proto-wine/proton.cpp | 12 |
5 files changed, 77 insertions, 13 deletions
diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index 719da51f..ae7c6c31 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -57,15 +57,26 @@ module_status wine::initialize() static const QString library_path(OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH); QString wine_path = "wine"; + auto env = QProcessEnvironment::systemEnvironment(); + if (s.variant_proton) { - QProcessEnvironment make_steam_environ(const QString& proton_version); + if (s.proton_appid == 0) + return error(tr("Must specify application id for Proton (Steam Play)")); + + QProcessEnvironment make_steam_environ(const QString& proton_version, int appid); QString proton_path(const QString& proton_version); wine_path = proton_path(s.proton_version); - wrapper.setProcessEnvironment(make_steam_environ(s.proton_version)); + env = make_steam_environ(s.proton_version, s.proton_appid); } + if (s.esync) + env.insert("WINEESYNC", "1"); + if (s.fsync) + env.insert("WINEFSYNC", "1"); + + wrapper.setProcessEnvironment(env); wrapper.setWorkingDirectory(OPENTRACK_BASE_PATH); wrapper.start(wine_path, { library_path + "opentrack-wrapper-wine.exe.so" }); #endif diff --git a/proto-wine/ftnoir_protocol_wine.h b/proto-wine/ftnoir_protocol_wine.h index 3c64df68..9266e455 100644 --- a/proto-wine/ftnoir_protocol_wine.h +++ b/proto-wine/ftnoir_protocol_wine.h @@ -19,7 +19,10 @@ struct settings : opts { settings() : opts{"proto-wine"} {} value<bool> variant_proton{b, "variant-proton", false }, - variant_wine{b, "variant-wine", true }; + variant_wine{b, "variant-wine", true }, + fsync{b, "fsync", true}, + esync{b, "esync", true}; + value<int> proton_appid{b, "proton-appid", 0}; value<QString> proton_version{b, "proton-version", {} }; }; diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index bf431c66..b63268d0 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -16,6 +16,9 @@ FTControls::FTControls() tie_setting(s.proton_version, ui.proton_version); tie_setting(s.variant_wine, ui.variant_wine); tie_setting(s.variant_proton, ui.variant_proton); + tie_setting(s.esync, ui.esync); + tie_setting(s.fsync, ui.fsync); + tie_setting(s.proton_appid, ui.proton_appid); connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &FTControls::doOK); connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &FTControls::doCancel); diff --git a/proto-wine/ftnoir_winecontrols.ui b/proto-wine/ftnoir_winecontrols.ui index 79fca47d..19180f19 100644 --- a/proto-wine/ftnoir_winecontrols.ui +++ b/proto-wine/ftnoir_winecontrols.ui @@ -9,8 +9,8 @@ <rect> <x>0</x> <y>0</y> - <width>332</width> - <height>204</height> + <width>471</width> + <height>400</height> </rect> </property> <property name="windowTitle"> @@ -55,7 +55,7 @@ </sizepolicy> </property> <property name="text"> - <string>Proton (Steam)</string> + <string>Proton (Steam Play)</string> </property> </widget> </item> @@ -79,6 +79,55 @@ </widget> </item> <item> + <widget class="QGroupBox" name="groupBox_2"> + <property name="title"> + <string>Advanced</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QCheckBox" name="esync"> + <property name="toolTip"> + <string><html><head/><body><p>When supported.</p></body></html></string> + </property> + <property name="text"> + <string>ESYNC</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="fsync"> + <property name="toolTip"> + <string><html><head/><body><p>When supported.</p></body></html></string> + </property> + <property name="text"> + <string>FSYNC</string> + </property> + </widget> + </item> + <item> + <widget class="QWidget" name="widget" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Application id (Proton only)</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="proton_appid"> + <property name="maximum"> + <number>2147483647</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QDialogButtonBox" name="buttonBox"> <property name="standardButtons"> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> diff --git a/proto-wine/proton.cpp b/proto-wine/proton.cpp index 9cc4af30..15306d26 100644 --- a/proto-wine/proton.cpp +++ b/proto-wine/proton.cpp @@ -11,7 +11,7 @@ #include <QString> #include <QProcessEnvironment> -QProcessEnvironment make_steam_environ(const QString& proton_version) +QProcessEnvironment make_steam_environ(const QString& proton_version, int appid) { auto ret = QProcessEnvironment::systemEnvironment(); QString home = qgetenv("HOME"); @@ -23,9 +23,9 @@ QProcessEnvironment make_steam_environ(const QString& proton_version) }; QString path = expand( - "HOME/.local/share/Steam/steamapps/common/Proton PROTON/dist/bin:" - "HOME/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/bin:" - "HOME/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/bin" + ":HOME/.local/share/Steam/steamapps/common/Proton PROTON/dist/bin" + ":HOME/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/bin" + ":HOME/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/bin" ); path += ':'; path += qgetenv("PATH"); ret.insert("PATH", path); @@ -46,9 +46,7 @@ QProcessEnvironment make_steam_environ(const QString& proton_version) ); library_path += ':'; library_path += qgetenv("LD_LIBRARY_PATH"); ret.insert("LD_LIBRARY_PATH", library_path); - - ret.insert("WINEPREFIX", expand("HOME/.local/share/Steam/steamapps/compatdata/805550/pfx")); - ret.insert("WINEESYNC", "1"); + ret.insert("WINEPREFIX", expand("HOME/.local/share/Steam/steamapps/compatdata/%1/pfx").arg(appid)); return ret; } |