From 33af0c6a7c2f9722883fbe65a8683731bccc50cf Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 8 Aug 2022 21:05:02 +0200 Subject: refactor: don't include mangohud's library path This could cause issues on some environments. Users should just put MangoHud libs into global LD_LIBRARY_PATH, just like with any other library Signed-off-by: Sefa Eyeoglu --- launcher/minecraft/MinecraftInstance.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'launcher/minecraft/MinecraftInstance.cpp') diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index 5a6f8de0..67a9332e 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -450,10 +450,8 @@ QProcessEnvironment MinecraftInstance::createLaunchEnvironment() if (settings()->get("EnableMangoHud").toBool()) { auto preload = env.value("LD_PRELOAD", "") + ":libMangoHud_dlsym.so:libMangoHud.so"; - auto lib_path = env.value("LD_LIBRARY_PATH", "") + ":/usr/local/$LIB/mangohud/:/usr/$LIB/mangohud/"; env.insert("LD_PRELOAD", preload); - env.insert("LD_LIBRARY_PATH", lib_path); env.insert("MANGOHUD", "1"); } -- cgit From d82bb29919d1cc6a9ead4a4e4a18d7b02c5221eb Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 8 Aug 2022 21:19:42 +0200 Subject: fix: don't apply GameMode/MangoHud, if they aren't supported Signed-off-by: Sefa Eyeoglu --- launcher/minecraft/MinecraftInstance.cpp | 2 +- launcher/minecraft/launch/DirectJavaLaunch.cpp | 4 +++- launcher/minecraft/launch/LauncherPartLaunch.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'launcher/minecraft/MinecraftInstance.cpp') diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index 67a9332e..822186b5 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -447,7 +447,7 @@ QProcessEnvironment MinecraftInstance::createLaunchEnvironment() QProcessEnvironment env = createEnvironment(); #ifdef Q_OS_LINUX - if (settings()->get("EnableMangoHud").toBool()) + if (settings()->get("EnableMangoHud").toBool() && APPLICATION->capabilities() & Application::SupportsMangoHud) { auto preload = env.value("LD_PRELOAD", "") + ":libMangoHud_dlsym.so:libMangoHud.so"; diff --git a/launcher/minecraft/launch/DirectJavaLaunch.cpp b/launcher/minecraft/launch/DirectJavaLaunch.cpp index 152485b3..ca55cd2e 100644 --- a/launcher/minecraft/launch/DirectJavaLaunch.cpp +++ b/launcher/minecraft/launch/DirectJavaLaunch.cpp @@ -21,6 +21,8 @@ #include #include +#include "Application.h" + #ifdef Q_OS_LINUX #include "gamemode_client.h" #endif @@ -86,7 +88,7 @@ void DirectJavaLaunch::executeTask() } #ifdef Q_OS_LINUX - if (instance->settings()->get("EnableFeralGamemode").toBool()) + if (instance->settings()->get("EnableFeralGamemode").toBool() && APPLICATION->capabilities() & Application::SupportsGameMode) { auto pid = m_process.processId(); if (pid) diff --git a/launcher/minecraft/launch/LauncherPartLaunch.cpp b/launcher/minecraft/launch/LauncherPartLaunch.cpp index 63e4d90f..ce477ad7 100644 --- a/launcher/minecraft/launch/LauncherPartLaunch.cpp +++ b/launcher/minecraft/launch/LauncherPartLaunch.cpp @@ -181,7 +181,7 @@ void LauncherPartLaunch::executeTask() } #ifdef Q_OS_LINUX - if (instance->settings()->get("EnableFeralGamemode").toBool()) + if (instance->settings()->get("EnableFeralGamemode").toBool() && APPLICATION->capabilities() & Application::SupportsGameMode) { auto pid = m_process.processId(); if (pid) -- cgit