diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b614e2..a44d207 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ find_package(Qt5 COMPONENTS Core Widgets Network CONFIG REQUIRED) option(ENABLE_WATCHDOG "Build with Tesseract support (needed for Watchdog)" OFF) option(USE_OWN_LIBRARIES "Build with own libraries" OFF) +option(BUILD_FLATPAK "Build with Flatpak support in mind" OFF) if(ENABLE_WATCHDOG) find_package(PkgConfig REQUIRED) @@ -171,6 +172,10 @@ if(ENABLE_WATCHDOG) target_compile_definitions(astra PRIVATE ENABLE_WATCHDOG) endif() +if(BUILD_FLATPAK) + target_compile_definitions(astra PRIVATE FLATPAK) +endif() + install(TARGETS astra DESTINATION "${INSTALL_BIN_PATH}") diff --git a/external/libxiv b/external/libxiv index 79c482a..8b3aed1 160000 --- a/external/libxiv +++ b/external/libxiv @@ -1 +1 @@ -Subproject commit 79c482ac97f212cd968ea8717645a05b5bd40fac +Subproject commit 8b3aed1f29d210a029cd62a6e59bf43db5ce516c diff --git a/src/launchercore.cpp b/src/launchercore.cpp index 45f600b..4c161ca 100755 --- a/src/launchercore.cpp +++ b/src/launchercore.cpp @@ -220,8 +220,6 @@ void LauncherCore::launchExecutable(const ProfileSettings& profile, QProcess* pr #endif } - process->setProcessChannelMode(QProcess::ForwardedChannels); - #if defined(Q_OS_LINUX) if (isGame) { if (profile.useGamescope) { @@ -270,6 +268,11 @@ void LauncherCore::launchExecutable(const ProfileSettings& profile, QProcess* pr env.insert("DYLD_FALLBACK_LIBRARY_PATH", xivLibPath); } +#if defined(FLATPAK) + arguments.push_back("flatpak-spawn"); + arguments.push_back("--host"); +#endif + arguments.push_back(profile.winePath); #endif @@ -475,7 +478,8 @@ void LauncherCore::readWineInfo(ProfileSettings& profile) { profile.wineVersion = wineProcess->readAllStandardOutput().trimmed(); }); - wineProcess->start(profile.winePath, {"--version"}); + launchExecutable(profile, wineProcess, {"--version"}, false, false); + wineProcess->waitForFinished(); #endif } @@ -692,4 +696,4 @@ void LauncherCore::addRegistryKey(const ProfileSettings& settings, auto process = new QProcess(this); process->setProcessEnvironment(QProcessEnvironment::systemEnvironment()); launchExecutable(settings, process, {"reg", "add", key, "/v", value, "/d", data, "/f" }, false, false); -} +} \ No newline at end of file