From a5a2ec4f7a855ad35bde6362796a0a07fd419cf7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 27 Oct 2019 07:25:43 +0100 Subject: proto/wine: add support for proton --- proto-wine/ftnoir_protocol_wine.cpp | 14 ++- proto-wine/ftnoir_protocol_wine.h | 13 ++ proto-wine/ftnoir_protocol_wine_dialog.cpp | 26 +++- proto-wine/ftnoir_winecontrols.ui | 195 +++++++++-------------------- proto-wine/lang/nl_NL.ts | 8 +- proto-wine/lang/ru_RU.ts | 8 +- proto-wine/lang/stub.ts | 8 +- proto-wine/lang/zh_CN.ts | 8 +- proto-wine/proton.cpp | 96 ++++++++++++++ 9 files changed, 221 insertions(+), 155 deletions(-) create mode 100644 proto-wine/proton.cpp diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index 2e618ff9..ce6f6229 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -51,12 +51,24 @@ void wine::pose(const double *headpose, const double*) } } +QProcessEnvironment make_steam_environ(const QString& proton_version); +QString proton_path(const QString& proton_version); + module_status wine::initialize() { #ifndef OTR_WINE_NO_WRAPPER static const QString library_path(OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH); + + QString wine_path = "wine"; + auto env = QProcessEnvironment::systemEnvironment(); + if (s.variant_proton) + { + env = make_steam_environ(s.proton_version); + wine_path = proton_path(s.proton_version); + } + wrapper.setWorkingDirectory(OPENTRACK_BASE_PATH); - wrapper.start("wine", { library_path + "opentrack-wrapper-wine.exe.so" }); + wrapper.start(wine_path, { library_path + "opentrack-wrapper-wine.exe.so" }); #endif if (lck_shm.success()) diff --git a/proto-wine/ftnoir_protocol_wine.h b/proto-wine/ftnoir_protocol_wine.h index ed142f83..3c64df68 100644 --- a/proto-wine/ftnoir_protocol_wine.h +++ b/proto-wine/ftnoir_protocol_wine.h @@ -6,12 +6,23 @@ #include "ui_ftnoir_winecontrols.h" +#include "options/options.hpp" +using namespace options; + #include #include #include #include +struct settings : opts +{ + settings() : opts{"proto-wine"} {} + value variant_proton{b, "variant-proton", false }, + variant_wine{b, "variant-wine", true }; + value proton_version{b, "proton-version", {} }; +}; + class wine : TR, public IProtocol { Q_OBJECT @@ -35,6 +46,7 @@ public: private: shm_wrapper lck_shm { WINE_SHM_NAME, WINE_MTX_NAME, sizeof(WineSHM) }; WineSHM* shm = nullptr; + settings s; #ifndef OTR_WINE_NO_WRAPPER QProcess wrapper; @@ -55,6 +67,7 @@ public: private: Ui::UICFTControls ui; + settings s; private slots: void doOK(); diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index a388df70..bf431c66 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -2,18 +2,34 @@ #include #include "api/plugin-api.hpp" +static const char* proton_versions[] = { + "4.11", "4.2", "3.16", "3.7", +}; + FTControls::FTControls() { - ui.setupUi( this ); - connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); - connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); + ui.setupUi(this); + + for (const char* version : proton_versions) + ui.proton_version->addItem(version, QVariant{version}); + + tie_setting(s.proton_version, ui.proton_version); + tie_setting(s.variant_wine, ui.variant_wine); + tie_setting(s.variant_proton, ui.variant_proton); + + connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &FTControls::doOK); + connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &FTControls::doCancel); } -void FTControls::doOK() { +void FTControls::doOK() +{ + s.b->save(); close(); } -void FTControls::doCancel() { +void FTControls::doCancel() +{ + s.b->reload(); close(); } diff --git a/proto-wine/ftnoir_winecontrols.ui b/proto-wine/ftnoir_winecontrols.ui index 9356c448..79fca47d 100644 --- a/proto-wine/ftnoir_winecontrols.ui +++ b/proto-wine/ftnoir_winecontrols.ui @@ -9,16 +9,16 @@ 0 0 - 409 - 110 + 332 + 204 - FreeTrack settings FaceTrackNoIR + Wine settings - - images/freetrack.pngimages/freetrack.png + + :/images/wine.png:/images/wine.png Qt::LeftToRight @@ -26,141 +26,70 @@ false - + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - + + + Wine variant - + + + + + + 0 + 0 + + + + Wine (system) + + + + + + + + 0 + 0 + + + + Proton (Steam) + + + + + + + + 0 + 0 + + + + + 120 + 0 + + + + + + - - - - - There are no settings necessary for the Wine protocol. - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - QLayout::SetDefaultConstraint - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - OK - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - Cancel - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + - + + + startEngineClicked() diff --git a/proto-wine/lang/nl_NL.ts b/proto-wine/lang/nl_NL.ts index 239e73d1..41f368c6 100644 --- a/proto-wine/lang/nl_NL.ts +++ b/proto-wine/lang/nl_NL.ts @@ -4,19 +4,19 @@ UICFTControls - FreeTrack settings FaceTrackNoIR + Wine settings - There are no settings necessary for the Wine protocol. + Wine variant - OK + Wine (system) - Cancel + Proton (Steam) diff --git a/proto-wine/lang/ru_RU.ts b/proto-wine/lang/ru_RU.ts index 1e80e43f..d6a10fac 100644 --- a/proto-wine/lang/ru_RU.ts +++ b/proto-wine/lang/ru_RU.ts @@ -4,19 +4,19 @@ UICFTControls - FreeTrack settings FaceTrackNoIR + Wine settings - There are no settings necessary for the Wine protocol. + Wine variant - OK + Wine (system) - Cancel + Proton (Steam) diff --git a/proto-wine/lang/stub.ts b/proto-wine/lang/stub.ts index 2da10a0b..2b4793e0 100644 --- a/proto-wine/lang/stub.ts +++ b/proto-wine/lang/stub.ts @@ -4,19 +4,19 @@ UICFTControls - FreeTrack settings FaceTrackNoIR + Wine settings - There are no settings necessary for the Wine protocol. + Wine variant - OK + Wine (system) - Cancel + Proton (Steam) diff --git a/proto-wine/lang/zh_CN.ts b/proto-wine/lang/zh_CN.ts index 2da10a0b..2b4793e0 100644 --- a/proto-wine/lang/zh_CN.ts +++ b/proto-wine/lang/zh_CN.ts @@ -4,19 +4,19 @@ UICFTControls - FreeTrack settings FaceTrackNoIR + Wine settings - There are no settings necessary for the Wine protocol. + Wine variant - OK + Wine (system) - Cancel + Proton (Steam) diff --git a/proto-wine/proton.cpp b/proto-wine/proton.cpp new file mode 100644 index 00000000..c36dbc86 --- /dev/null +++ b/proto-wine/proton.cpp @@ -0,0 +1,96 @@ +/* Copyright (c) 2019 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#ifndef OTR_WINE_NO_WRAPPER + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +static QString home_directory() +{ + struct passwd *pwptr = nullptr, pw{}; + uid_t uid = getuid(); + int shift = 16; + do { + auto buf = std::make_unique(1 << shift); + int error = getpwuid_r(uid, &pw, buf.get(), 1 << shift, &pwptr); + if (error) + { + if (errno != EDOM) + return {}; + else + continue; + } + else + break; + } while (++shift < 28); + + if (!pwptr) + return {}; + + return pwptr->pw_dir; +} + +QProcessEnvironment make_steam_environ(const QString& proton_version) +{ + auto ret = QProcessEnvironment::systemEnvironment(); + QString home = home_directory(); + + auto expand = [&](QString x) { + x.replace("HOME", home); + x.replace("PROTON", proton_version); + return x; + }; + + 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" + ); + path += ':'; path += qgetenv("PATH"); + ret.insert("PATH", path); + + QString library_path = expand( + ":HOME/.local/share/Steam/steamapps/common/Proton PROTON/dist/lib" + ":HOME/.local/share/Steam/steamapps/common/Proton PROTON/dist/lib64" + ":HOME/.local/share/Steam/ubuntu12_32/steam-runtime/pinned_libs_32" + ":HOME/.local/share/Steam/ubuntu12_32/steam-runtime/pinned_libs_64" + ":HOME/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu" + ":HOME/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib" + ":HOME/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu" + ":HOME/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib" + ":HOME/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu" + ":HOME/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib" + ":HOME/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu" + ":HOME/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib" + ); + 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"); + + return ret; +} + +QString proton_path(const QString& proton_version) +{ + QString wine_path = "HOME/.local/share/Steam/steamapps/common/Proton PROTON/dist/bin/wine"; + wine_path.replace("HOME", home_directory()); wine_path.replace("PROTON", proton_version); + return wine_path; +} + +#endif -- cgit v1.2.3 From 9aef0bbdd753939623562f6112adf4e19576c015 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 27 Oct 2019 07:51:20 +0100 Subject: proto/wine: assume HOME exists in environ --- proto-wine/proton.cpp | 38 +++----------------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/proto-wine/proton.cpp b/proto-wine/proton.cpp index c36dbc86..9cc4af30 100644 --- a/proto-wine/proton.cpp +++ b/proto-wine/proton.cpp @@ -7,47 +7,14 @@ #ifndef OTR_WINE_NO_WRAPPER -#include -#include -#include -#include - -#include - #include #include #include -#include - -static QString home_directory() -{ - struct passwd *pwptr = nullptr, pw{}; - uid_t uid = getuid(); - int shift = 16; - do { - auto buf = std::make_unique(1 << shift); - int error = getpwuid_r(uid, &pw, buf.get(), 1 << shift, &pwptr); - if (error) - { - if (errno != EDOM) - return {}; - else - continue; - } - else - break; - } while (++shift < 28); - - if (!pwptr) - return {}; - - return pwptr->pw_dir; -} QProcessEnvironment make_steam_environ(const QString& proton_version) { auto ret = QProcessEnvironment::systemEnvironment(); - QString home = home_directory(); + QString home = qgetenv("HOME"); auto expand = [&](QString x) { x.replace("HOME", home); @@ -89,7 +56,8 @@ QProcessEnvironment make_steam_environ(const QString& proton_version) QString proton_path(const QString& proton_version) { QString wine_path = "HOME/.local/share/Steam/steamapps/common/Proton PROTON/dist/bin/wine"; - wine_path.replace("HOME", home_directory()); wine_path.replace("PROTON", proton_version); + wine_path.replace("HOME", qgetenv("HOME")); + wine_path.replace("PROTON", proton_version); return wine_path; } -- cgit v1.2.3 From 8601e6f1ee395a89867f404b36bc93077baff8ff Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 27 Oct 2019 08:08:29 +0100 Subject: proto/wine: move function prototypes --- proto-wine/ftnoir_protocol_wine.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index ce6f6229..a2a49940 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -51,9 +51,6 @@ void wine::pose(const double *headpose, const double*) } } -QProcessEnvironment make_steam_environ(const QString& proton_version); -QString proton_path(const QString& proton_version); - module_status wine::initialize() { #ifndef OTR_WINE_NO_WRAPPER @@ -63,8 +60,11 @@ module_status wine::initialize() auto env = QProcessEnvironment::systemEnvironment(); if (s.variant_proton) { - env = make_steam_environ(s.proton_version); - wine_path = proton_path(s.proton_version); + QProcessEnvironment make_steam_environ(const QString& proton_version); + QString proton_path(const QString& proton_version); + + env = make_steam_environ(s.proton_version); + wine_path = proton_path(s.proton_version); } wrapper.setWorkingDirectory(OPENTRACK_BASE_PATH); -- cgit v1.2.3 From 2f07cc9958f31e405db7498989e90755234c7c47 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 27 Oct 2019 14:30:47 +0100 Subject: proto/wine: actually set environ --- proto-wine/ftnoir_protocol_wine.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index a2a49940..719da51f 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -57,14 +57,13 @@ 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); QString proton_path(const QString& proton_version); - env = make_steam_environ(s.proton_version); wine_path = proton_path(s.proton_version); + wrapper.setProcessEnvironment(make_steam_environ(s.proton_version)); } wrapper.setWorkingDirectory(OPENTRACK_BASE_PATH); -- cgit v1.2.3 From 69c9a4136d2decc10f97ad49189070d8e4708110 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 28 Oct 2019 07:45:16 +0100 Subject: proto/wine: implement more proton knobs Reported by: @jp7677 Issue: #996 --- proto-wine/ftnoir_protocol_wine.cpp | 15 ++++++-- proto-wine/ftnoir_protocol_wine.h | 5 ++- proto-wine/ftnoir_protocol_wine_dialog.cpp | 3 ++ proto-wine/ftnoir_winecontrols.ui | 55 ++++++++++++++++++++++++++++-- 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 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 proton_appid{b, "proton-appid", 0}; value 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 @@ 0 0 - 332 - 204 + 471 + 400 @@ -55,7 +55,7 @@ - Proton (Steam) + Proton (Steam Play) @@ -78,6 +78,55 @@ + + + + Advanced + + + + + + <html><head/><body><p>When supported.</p></body></html> + + + ESYNC + + + + + + + <html><head/><body><p>When supported.</p></body></html> + + + FSYNC + + + + + + + + + + Application id (Proton only) + + + + + + + 2147483647 + + + + + + + + + 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 #include -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; } -- cgit v1.2.3 From 8619641a9a129588445c2d063560a48fbf5fa623 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 28 Oct 2019 07:46:01 +0100 Subject: proto/wine: refresh i18n --- proto-wine/lang/nl_NL.ts | 26 +++++++++++++++++++++++++- proto-wine/lang/ru_RU.ts | 26 +++++++++++++++++++++++++- proto-wine/lang/stub.ts | 26 +++++++++++++++++++++++++- proto-wine/lang/zh_CN.ts | 26 +++++++++++++++++++++++++- 4 files changed, 100 insertions(+), 4 deletions(-) diff --git a/proto-wine/lang/nl_NL.ts b/proto-wine/lang/nl_NL.ts index 41f368c6..39c5775c 100644 --- a/proto-wine/lang/nl_NL.ts +++ b/proto-wine/lang/nl_NL.ts @@ -16,7 +16,27 @@ - Proton (Steam) + Advanced + + + + ESYNC + + + + FSYNC + + + + Proton (Steam Play) + + + + Application id (Proton only) + + + + <html><head/><body><p>When supported.</p></body></html> @@ -26,6 +46,10 @@ Can't open shared memory mapping + + Must specify application id for Proton (Steam Play) + + wine_metadata diff --git a/proto-wine/lang/ru_RU.ts b/proto-wine/lang/ru_RU.ts index d6a10fac..84e7fd90 100644 --- a/proto-wine/lang/ru_RU.ts +++ b/proto-wine/lang/ru_RU.ts @@ -16,7 +16,27 @@ - Proton (Steam) + Advanced + + + + ESYNC + + + + FSYNC + + + + Proton (Steam Play) + + + + Application id (Proton only) + + + + <html><head/><body><p>When supported.</p></body></html> @@ -26,6 +46,10 @@ Can't open shared memory mapping + + Must specify application id for Proton (Steam Play) + + wine_metadata diff --git a/proto-wine/lang/stub.ts b/proto-wine/lang/stub.ts index 2b4793e0..0231ebb2 100644 --- a/proto-wine/lang/stub.ts +++ b/proto-wine/lang/stub.ts @@ -16,7 +16,27 @@ - Proton (Steam) + Advanced + + + + ESYNC + + + + FSYNC + + + + Proton (Steam Play) + + + + Application id (Proton only) + + + + <html><head/><body><p>When supported.</p></body></html> @@ -26,6 +46,10 @@ Can't open shared memory mapping + + Must specify application id for Proton (Steam Play) + + wine_metadata diff --git a/proto-wine/lang/zh_CN.ts b/proto-wine/lang/zh_CN.ts index 2b4793e0..0231ebb2 100644 --- a/proto-wine/lang/zh_CN.ts +++ b/proto-wine/lang/zh_CN.ts @@ -16,7 +16,27 @@ - Proton (Steam) + Advanced + + + + ESYNC + + + + FSYNC + + + + Proton (Steam Play) + + + + Application id (Proton only) + + + + <html><head/><body><p>When supported.</p></body></html> @@ -26,6 +46,10 @@ Can't open shared memory mapping + + Must specify application id for Proton (Steam Play) + + wine_metadata -- cgit v1.2.3 From 14121af362bee65f196082f9e0bc242d59d1e9b7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 29 Oct 2019 03:54:33 +0100 Subject: proto/wine: use more common term for steam appid Suggested by: @jp7677 --- proto-wine/ftnoir_winecontrols.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto-wine/ftnoir_winecontrols.ui b/proto-wine/ftnoir_winecontrols.ui index 19180f19..12aebd57 100644 --- a/proto-wine/ftnoir_winecontrols.ui +++ b/proto-wine/ftnoir_winecontrols.ui @@ -9,7 +9,7 @@ 0 0 - 471 + 492 400 @@ -110,7 +110,7 @@ - Application id (Proton only) + Steam application id (Proton) -- cgit v1.2.3 From 21ae7a6fa95ccce0e9bb12e305c902697192a4e8 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 29 Oct 2019 04:01:33 +0100 Subject: proto/{wine,freetrack}: add 64-bit version for freetrackclient --- bin/freetrackclient64.dll | Bin 0 -> 16384 bytes cmake/opentrack-install.cmake | 1 + 2 files changed, 1 insertion(+) create mode 100644 bin/freetrackclient64.dll diff --git a/bin/freetrackclient64.dll b/bin/freetrackclient64.dll new file mode 100644 index 00000000..e1074592 Binary files /dev/null and b/bin/freetrackclient64.dll differ diff --git a/cmake/opentrack-install.cmake b/cmake/opentrack-install.cmake index 1f4eaa09..2b745a82 100644 --- a/cmake/opentrack-install.cmake +++ b/cmake/opentrack-install.cmake @@ -72,6 +72,7 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") endif() otr_install_exec("${opentrack-hier-pfx}" FILES "${CMAKE_SOURCE_DIR}/bin/freetrackclient.dll") +otr_install_exec("${opentrack-hier-pfx}" FILES "${CMAKE_SOURCE_DIR}/bin/freetrackclient64.dll") otr_install_exec("${opentrack-hier-pfx}" FILES "${CMAKE_SOURCE_DIR}/bin/NPClient.dll" "${CMAKE_SOURCE_DIR}/bin/NPClient64.dll" -- cgit v1.2.3 From d5d4bdceac4e72e0d1567ab79a6bba94b5c6caac Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 29 Oct 2019 04:03:28 +0100 Subject: freetrackclient: fix mingw-w64 --- freetrackclient/freetrackclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freetrackclient/freetrackclient.c b/freetrackclient/freetrackclient.c index 2049d91e..b23348f2 100644 --- a/freetrackclient/freetrackclient.c +++ b/freetrackclient/freetrackclient.c @@ -32,7 +32,7 @@ #include "fttypes.h" -#if !defined _WIN64 +#if defined _MSC_VER && !defined _WIN64 # define FT_EXPORT(t) t __stdcall #else # define FT_EXPORT(t) __declspec(dllexport) t -- cgit v1.2.3 From 801c01b8f2770ed5bdadf96aeeba176fa09239f4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 29 Oct 2019 04:03:37 +0100 Subject: freetrackclient: kill spurious warning --- freetrackclient/freetrackclient.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/freetrackclient/freetrackclient.c b/freetrackclient/freetrackclient.c index b23348f2..80169771 100644 --- a/freetrackclient/freetrackclient.c +++ b/freetrackclient/freetrackclient.c @@ -18,10 +18,6 @@ * * created by the FreeTrack developers. * */ -#ifndef _MSC_VER -# warning "expect misnamed symbols" -#endif - #ifdef __GNUC__ #pragma GCC diagnostic ignored "-Wvariadic-macros" #pragma GCC diagnostic ignored "-Wunused-parameter" -- cgit v1.2.3 From 5b0f05ec74fffb1380285ef491eb5b68aab386d6 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 29 Oct 2019 04:03:49 +0100 Subject: proto/wine: refresh i18n --- proto-wine/lang/nl_NL.ts | 4 ++-- proto-wine/lang/ru_RU.ts | 4 ++-- proto-wine/lang/stub.ts | 4 ++-- proto-wine/lang/zh_CN.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/proto-wine/lang/nl_NL.ts b/proto-wine/lang/nl_NL.ts index 39c5775c..e2d594a3 100644 --- a/proto-wine/lang/nl_NL.ts +++ b/proto-wine/lang/nl_NL.ts @@ -32,11 +32,11 @@ - Application id (Proton only) + <html><head/><body><p>When supported.</p></body></html> - <html><head/><body><p>When supported.</p></body></html> + Steam application id (Proton) diff --git a/proto-wine/lang/ru_RU.ts b/proto-wine/lang/ru_RU.ts index 84e7fd90..afd33eea 100644 --- a/proto-wine/lang/ru_RU.ts +++ b/proto-wine/lang/ru_RU.ts @@ -32,11 +32,11 @@ - Application id (Proton only) + <html><head/><body><p>When supported.</p></body></html> - <html><head/><body><p>When supported.</p></body></html> + Steam application id (Proton) diff --git a/proto-wine/lang/stub.ts b/proto-wine/lang/stub.ts index 0231ebb2..b0ced919 100644 --- a/proto-wine/lang/stub.ts +++ b/proto-wine/lang/stub.ts @@ -32,11 +32,11 @@ - Application id (Proton only) + <html><head/><body><p>When supported.</p></body></html> - <html><head/><body><p>When supported.</p></body></html> + Steam application id (Proton) diff --git a/proto-wine/lang/zh_CN.ts b/proto-wine/lang/zh_CN.ts index 0231ebb2..b0ced919 100644 --- a/proto-wine/lang/zh_CN.ts +++ b/proto-wine/lang/zh_CN.ts @@ -32,11 +32,11 @@ - Application id (Proton only) + <html><head/><body><p>When supported.</p></body></html> - <html><head/><body><p>When supported.</p></body></html> + Steam application id (Proton) -- cgit v1.2.3 From ec00863aff826bc63f221136caf54da8b9285201 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 29 Oct 2019 04:32:59 +0100 Subject: proto/wine: add support for setting WINEPREFIX --- proto-wine/ftnoir_protocol_wine.cpp | 13 ++++++ proto-wine/ftnoir_protocol_wine.h | 6 ++- proto-wine/ftnoir_protocol_wine_dialog.cpp | 1 + proto-wine/ftnoir_winecontrols.ui | 72 +++++++++++++++++++++++++----- proto-wine/lang/nl_NL.ts | 10 +++-- proto-wine/lang/ru_RU.ts | 10 +++-- proto-wine/lang/stub.ts | 10 +++-- proto-wine/lang/zh_CN.ts | 10 +++-- 8 files changed, 108 insertions(+), 24 deletions(-) diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index ae7c6c31..bed1fed3 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -70,6 +70,19 @@ module_status wine::initialize() wine_path = proton_path(s.proton_version); env = make_steam_environ(s.proton_version, s.proton_appid); } + else + { + QString wineprefix = "~/.wine"; + if (!s.wineprefix->isEmpty()) + wineprefix = s.wineprefix; + if (wineprefix[0] == '~') + wineprefix = qgetenv("HOME") + wineprefix.mid(1); + + if (wineprefix[0] != '/') + error(tr("Wine prefix must be an absolute path (given '%1')").arg(wineprefix)); + + env.insert("WINEPREFIX", wineprefix); + } if (s.esync) env.insert("WINEESYNC", "1"); diff --git a/proto-wine/ftnoir_protocol_wine.h b/proto-wine/ftnoir_protocol_wine.h index 9266e455..8175be03 100644 --- a/proto-wine/ftnoir_protocol_wine.h +++ b/proto-wine/ftnoir_protocol_wine.h @@ -22,8 +22,10 @@ struct settings : opts variant_wine{b, "variant-wine", true }, fsync{b, "fsync", true}, esync{b, "esync", true}; - value proton_appid{b, "proton-appid", 0}; - value proton_version{b, "proton-version", {} }; + + value proton_appid{b, "proton-appid", 0}; + value proton_version{b, "proton-version", {} }, + wineprefix{b, "wineprefix", "~/.wine"}; }; class wine : TR, public IProtocol diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index b63268d0..f1cb01c2 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -19,6 +19,7 @@ FTControls::FTControls() tie_setting(s.esync, ui.esync); tie_setting(s.fsync, ui.fsync); tie_setting(s.proton_appid, ui.proton_appid); + tie_setting(s.wineprefix, ui.wineprefix); 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 12aebd57..a0a1e071 100644 --- a/proto-wine/ftnoir_winecontrols.ui +++ b/proto-wine/ftnoir_winecontrols.ui @@ -9,8 +9,8 @@ 0 0 - 492 - 400 + 544 + 410 @@ -33,10 +33,26 @@ Wine variant + + + + + 0 + 0 + + + + + 120 + 0 + + + + - + 0 0 @@ -46,10 +62,10 @@ - + - + 0 0 @@ -59,17 +75,17 @@ - - + + - + 0 0 - 120 + 286 0 @@ -86,6 +102,12 @@ + + + 0 + 0 + + <html><head/><body><p>When supported.</p></body></html> @@ -96,6 +118,12 @@ + + + 0 + 0 + + <html><head/><body><p>When supported.</p></body></html> @@ -106,16 +134,34 @@ + + + 0 + 0 + + + + + 0 + 0 + + - Steam application id (Proton) + Steam application id + + + 0 + 0 + + 2147483647 @@ -129,6 +175,12 @@ + + + 0 + 0 + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok diff --git a/proto-wine/lang/nl_NL.ts b/proto-wine/lang/nl_NL.ts index e2d594a3..f71d8ad7 100644 --- a/proto-wine/lang/nl_NL.ts +++ b/proto-wine/lang/nl_NL.ts @@ -28,15 +28,15 @@ - Proton (Steam Play) + <html><head/><body><p>When supported.</p></body></html> - <html><head/><body><p>When supported.</p></body></html> + Steam application id - Steam application id (Proton) + Proton (Steam Play) @@ -50,6 +50,10 @@ Must specify application id for Proton (Steam Play) + + Wine prefix must be an absolute path (given '%1') + + wine_metadata diff --git a/proto-wine/lang/ru_RU.ts b/proto-wine/lang/ru_RU.ts index afd33eea..9937083f 100644 --- a/proto-wine/lang/ru_RU.ts +++ b/proto-wine/lang/ru_RU.ts @@ -28,15 +28,15 @@ - Proton (Steam Play) + <html><head/><body><p>When supported.</p></body></html> - <html><head/><body><p>When supported.</p></body></html> + Steam application id - Steam application id (Proton) + Proton (Steam Play) @@ -50,6 +50,10 @@ Must specify application id for Proton (Steam Play) + + Wine prefix must be an absolute path (given '%1') + + wine_metadata diff --git a/proto-wine/lang/stub.ts b/proto-wine/lang/stub.ts index b0ced919..9b74a44d 100644 --- a/proto-wine/lang/stub.ts +++ b/proto-wine/lang/stub.ts @@ -28,15 +28,15 @@ - Proton (Steam Play) + <html><head/><body><p>When supported.</p></body></html> - <html><head/><body><p>When supported.</p></body></html> + Steam application id - Steam application id (Proton) + Proton (Steam Play) @@ -50,6 +50,10 @@ Must specify application id for Proton (Steam Play) + + Wine prefix must be an absolute path (given '%1') + + wine_metadata diff --git a/proto-wine/lang/zh_CN.ts b/proto-wine/lang/zh_CN.ts index b0ced919..9b74a44d 100644 --- a/proto-wine/lang/zh_CN.ts +++ b/proto-wine/lang/zh_CN.ts @@ -28,15 +28,15 @@ - Proton (Steam Play) + <html><head/><body><p>When supported.</p></body></html> - <html><head/><body><p>When supported.</p></body></html> + Steam application id - Steam application id (Proton) + Proton (Steam Play) @@ -50,6 +50,10 @@ Must specify application id for Proton (Steam Play) + + Wine prefix must be an absolute path (given '%1') + + wine_metadata -- cgit v1.2.3 From 29591277d9cae18895ef03cb858b2b327813830e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 30 Oct 2019 05:38:17 +0100 Subject: options: use ~/.config on Unix Fixes #807 --- options/globals.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/options/globals.cpp b/options/globals.cpp index 52e198db..099a7208 100644 --- a/options/globals.cpp +++ b/options/globals.cpp @@ -151,11 +151,20 @@ fail: constexpr const char* subdir = "ini"; } else { - const QString dir = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation).value(0, QString()); + QString dir = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation).value(0, QString()); if (dir.isEmpty()) goto fail; +#if !defined _WIN32 && !defined __APPLE__ + const QString fmt = QStringLiteral("%1/%2"); + if (!QFile::exists(fmt.arg(dir, OPENTRACK_ORG))) + { + dir = QStandardPaths::standardLocations(QStandardPaths::ConfigLocation).value(0, QString()); + if (dir.isEmpty()) + goto fail; + } +#endif (void)QDir(dir).mkpath(OPENTRACK_ORG); - return QStringLiteral("%1/%2").arg(dir, OPENTRACK_ORG); + return fmt.arg(dir, OPENTRACK_ORG); } } -- cgit v1.2.3