From bf42cfdcf2f3906be88515d81577d94b4545692d Mon Sep 17 00:00:00 2001 From: DioEgizio Date: Sat, 21 Mar 2026 09:12:47 +0100 Subject: [PATCH 1/4] fix: rename LAUNCHER_DISABLE_GLVULKAN to PRISMLAUNCHER_DISABLE_GLVULKAN for consistency with other env vars this also introduces LAUNCHER_ENVNAME in BuildConfig/program_info for rebranded configurations Signed-off-by: DioEgizio --- .github/actions/package/linux/action.yml | 2 +- buildconfig/BuildConfig.cpp.in | 1 + buildconfig/BuildConfig.h | 1 + launcher/HardwareInfo.cpp | 5 +++-- launcher/Launcher.in | 3 ++- launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp | 3 ++- program_info/CMakeLists.txt | 2 ++ 7 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/actions/package/linux/action.yml b/.github/actions/package/linux/action.yml index cd888409f..94a54ee70 100644 --- a/.github/actions/package/linux/action.yml +++ b/.github/actions/package/linux/action.yml @@ -91,7 +91,7 @@ runs: find "$INSTALL_APPIMAGE_DIR" -name '*gamemode*' -exec rm {} + #disable OpenGL and Vulkan launcher features until https://github.com/VHSgunzo/sharun/issues/35 - echo "LAUNCHER_DISABLE_GLVULKAN=1" > "$INSTALL_APPIMAGE_DIR"/.env + echo "PRISMLAUNCHER_DISABLE_GLVULKAN=1" > "$INSTALL_APPIMAGE_DIR"/.env #makes the launcher use portals for file picking echo "QT_QPA_PLATFORMTHEME=xdgdesktopportal" > "$INSTALL_APPIMAGE_DIR"/.env ln -s org.prismlauncher.PrismLauncher.metainfo.xml "$INSTALL_APPIMAGE_DIR"/share/metainfo/org.prismlauncher.PrismLauncher.appdata.xml diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 0d842a3ba..14d8236d8 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -50,6 +50,7 @@ Config::Config() LAUNCHER_GIT = "@Launcher_Git@"; LAUNCHER_APPID = "@Launcher_AppID@"; LAUNCHER_SVGFILENAME = "@Launcher_SVGFileName@"; + LAUNCHER_ENVNAME = "@Launcher_ENVName@"; USER_AGENT = "@Launcher_UserAgent@"; diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index a1719f361..d430622bc 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -54,6 +54,7 @@ class Config { QString LAUNCHER_GIT; QString LAUNCHER_APPID; QString LAUNCHER_SVGFILENAME; + QString LAUNCHER_ENVNAME; /// The major version number. int VERSION_MAJOR; diff --git a/launcher/HardwareInfo.cpp b/launcher/HardwareInfo.cpp index 9f0ce7cad..42ad77865 100644 --- a/launcher/HardwareInfo.cpp +++ b/launcher/HardwareInfo.cpp @@ -22,6 +22,7 @@ #include #include #include +#include "BuildConfig.h" #ifndef Q_OS_MACOS #include @@ -31,7 +32,7 @@ namespace { bool vulkanInfo(QStringList& out) { - if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("LAUNCHER_DISABLE_GLVULKAN")).isEmpty()) { + if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("%1_DISABLE_GLVULKAN").arg(BuildConfig.LAUNCHER_ENVNAME)).isEmpty()) { return false; } #ifndef Q_OS_MACOS @@ -57,7 +58,7 @@ bool vulkanInfo(QStringList& out) bool openGlInfo(QStringList& out) { - if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("LAUNCHER_DISABLE_GLVULKAN")).isEmpty()) { + if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("%1_DISABLE_GLVULKAN").arg(BuildConfig.LAUNCHER_ENVNAME)).isEmpty()) { return false; } QOpenGLContext ctx; diff --git a/launcher/Launcher.in b/launcher/Launcher.in index a7845b294..28ba32bf8 100755 --- a/launcher/Launcher.in +++ b/launcher/Launcher.in @@ -15,6 +15,7 @@ fi LAUNCHER_NAME=@Launcher_APP_BINARY_NAME@ +LAUNCHER_ENVNAME=@Launcher_ENVName@ LAUNCHER_DIR="$(dirname "$(readlink -f "$0")")" echo "Launcher Dir: ${LAUNCHER_DIR}" @@ -23,7 +24,7 @@ export QT_QPA_PLATFORMTHEME=xdgdesktopportal # disable OpenGL and Vulkan launcher features on sharun until https://github.com/VHSgunzo/sharun/issues/35 if [[ -f "${LAUNCHER_DIR}/sharun" ]]; then - export LAUNCHER_DISABLE_GLVULKAN=1 + export ${LAUNCHER_ENVNAME}_DISABLE_GLVULKAN=1 fi # Just to be sure... diff --git a/launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp b/launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp index 988996918..b2ae26f3f 100644 --- a/launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp +++ b/launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp @@ -30,6 +30,7 @@ #include "rainbow.h" #include "ui/dialogs/skins/draw/BoxGeometry.h" #include "ui/dialogs/skins/draw/Scene.h" +#include "BuildConfig.h" SkinOpenGLWindow::SkinOpenGLWindow(SkinProvider* parent, QColor color) : QOpenGLWindow(), QOpenGLFunctions(), m_baseColor(color), m_parent(parent) @@ -331,7 +332,7 @@ void SkinOpenGLWindow::setElytraVisible(bool visible) bool SkinOpenGLWindow::hasOpenGL() { - if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("LAUNCHER_DISABLE_GLVULKAN")).isEmpty()) { + if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("%1_DISABLE_GLVULKAN").arg(BuildConfig.LAUNCHER_ENVNAME)).isEmpty()) { return false; } diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 9c9e3ddba..4c30dab49 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -11,11 +11,13 @@ endif() set(Launcher_CommonName "PrismLauncher") set(Launcher_DisplayName "Prism Launcher") set(Launcher_AppID "org.prismlauncher.PrismLauncher") +set(Launcher_ENVName "PRISMLAUNCHER") set(Launcher_Domain "prismlauncher.org") set(Launcher_Git "https://github.com/PrismLauncher/PrismLauncher") set(Launcher_Name "${Launcher_CommonName}" PARENT_SCOPE) set(Launcher_DisplayName "${Launcher_DisplayName}" PARENT_SCOPE) +set(Launcher_ENVName "${Launcher_ENVName}" PARENT_SCOPE) set(Launcher_Domain "${Launcher_Domain}" PARENT_SCOPE) set(Launcher_Git "${Launcher_Git}" PARENT_SCOPE) From 1ea0c7570f05b77dbbfa657df3d64c5d84d42e92 Mon Sep 17 00:00:00 2001 From: DioEgizio Date: Thu, 26 Mar 2026 18:19:34 +0100 Subject: [PATCH 2/4] fix: dehardcode PRISMLAUNCHER_JAVA_PATHS too Signed-off-by: DioEgizio --- launcher/java/JavaUtils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/launcher/java/JavaUtils.cpp b/launcher/java/JavaUtils.cpp index 25fe1caa8..868ce5875 100644 --- a/launcher/java/JavaUtils.cpp +++ b/launcher/java/JavaUtils.cpp @@ -45,6 +45,7 @@ #include "FileSystem.h" #include "java/JavaInstallList.h" #include "java/JavaUtils.h" +#include "BuildConfig.h" #define IBUS "@im=ibus" @@ -155,7 +156,7 @@ JavaInstallPtr JavaUtils::GetDefaultJava() QStringList addJavasFromEnv(QList javas) { - auto env = qEnvironmentVariable("PRISMLAUNCHER_JAVA_PATHS"); // FIXME: use launcher name from buildconfig + auto env = qEnvironmentVariable("%1_JAVA_PATHS").arg(BuildConfig.LAUNCHER_ENVNAME); #if defined(Q_OS_WIN32) QList javaPaths = env.replace("\\", "/").split(QLatin1String(";")); From eb44bdc3b318f20661360e069d48f3a17d583797 Mon Sep 17 00:00:00 2001 From: DioEgizio Date: Thu, 26 Mar 2026 21:58:30 +0100 Subject: [PATCH 3/4] fix: fix PRISMLAUNCHER_JAVA_PATHS also set Launcher_ENVName as parent scope directly Signed-off-by: DioEgizio --- launcher/java/JavaUtils.cpp | 2 +- program_info/CMakeLists.txt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/launcher/java/JavaUtils.cpp b/launcher/java/JavaUtils.cpp index 868ce5875..43d6bbf68 100644 --- a/launcher/java/JavaUtils.cpp +++ b/launcher/java/JavaUtils.cpp @@ -156,7 +156,7 @@ JavaInstallPtr JavaUtils::GetDefaultJava() QStringList addJavasFromEnv(QList javas) { - auto env = qEnvironmentVariable("%1_JAVA_PATHS").arg(BuildConfig.LAUNCHER_ENVNAME); + auto env = QProcessEnvironment::systemEnvironment().value(QStringLiteral("%1_JAVA_PATHS").arg(BuildConfig.LAUNCHER_ENVNAME)); #if defined(Q_OS_WIN32) QList javaPaths = env.replace("\\", "/").split(QLatin1String(";")); diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 4c30dab49..3afd8a642 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -11,13 +11,12 @@ endif() set(Launcher_CommonName "PrismLauncher") set(Launcher_DisplayName "Prism Launcher") set(Launcher_AppID "org.prismlauncher.PrismLauncher") -set(Launcher_ENVName "PRISMLAUNCHER") set(Launcher_Domain "prismlauncher.org") set(Launcher_Git "https://github.com/PrismLauncher/PrismLauncher") set(Launcher_Name "${Launcher_CommonName}" PARENT_SCOPE) set(Launcher_DisplayName "${Launcher_DisplayName}" PARENT_SCOPE) -set(Launcher_ENVName "${Launcher_ENVName}" PARENT_SCOPE) +set(Launcher_ENVName "PRISMLAUNCHER" PARENT_SCOPE) set(Launcher_Domain "${Launcher_Domain}" PARENT_SCOPE) set(Launcher_Git "${Launcher_Git}" PARENT_SCOPE) From 63a8b43119a35bbdf2279954fb04a5111afce91f Mon Sep 17 00:00:00 2001 From: DioEgizio Date: Fri, 27 Mar 2026 07:24:15 +0100 Subject: [PATCH 4/4] chore: clang-format Signed-off-by: DioEgizio --- launcher/HardwareInfo.cpp | 8 ++++++-- launcher/java/JavaUtils.cpp | 2 +- launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp | 6 ++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/launcher/HardwareInfo.cpp b/launcher/HardwareInfo.cpp index 42ad77865..5937c33bc 100644 --- a/launcher/HardwareInfo.cpp +++ b/launcher/HardwareInfo.cpp @@ -32,7 +32,9 @@ namespace { bool vulkanInfo(QStringList& out) { - if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("%1_DISABLE_GLVULKAN").arg(BuildConfig.LAUNCHER_ENVNAME)).isEmpty()) { + if (!QProcessEnvironment::systemEnvironment() + .value(QStringLiteral("%1_DISABLE_GLVULKAN").arg(BuildConfig.LAUNCHER_ENVNAME)) + .isEmpty()) { return false; } #ifndef Q_OS_MACOS @@ -58,7 +60,9 @@ bool vulkanInfo(QStringList& out) bool openGlInfo(QStringList& out) { - if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("%1_DISABLE_GLVULKAN").arg(BuildConfig.LAUNCHER_ENVNAME)).isEmpty()) { + if (!QProcessEnvironment::systemEnvironment() + .value(QStringLiteral("%1_DISABLE_GLVULKAN").arg(BuildConfig.LAUNCHER_ENVNAME)) + .isEmpty()) { return false; } QOpenGLContext ctx; diff --git a/launcher/java/JavaUtils.cpp b/launcher/java/JavaUtils.cpp index 43d6bbf68..c58fe5601 100644 --- a/launcher/java/JavaUtils.cpp +++ b/launcher/java/JavaUtils.cpp @@ -42,10 +42,10 @@ #include #include "Application.h" +#include "BuildConfig.h" #include "FileSystem.h" #include "java/JavaInstallList.h" #include "java/JavaUtils.h" -#include "BuildConfig.h" #define IBUS "@im=ibus" diff --git a/launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp b/launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp index b2ae26f3f..ca6d6ad27 100644 --- a/launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp +++ b/launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp @@ -26,11 +26,11 @@ #include #include +#include "BuildConfig.h" #include "minecraft/skins/SkinModel.h" #include "rainbow.h" #include "ui/dialogs/skins/draw/BoxGeometry.h" #include "ui/dialogs/skins/draw/Scene.h" -#include "BuildConfig.h" SkinOpenGLWindow::SkinOpenGLWindow(SkinProvider* parent, QColor color) : QOpenGLWindow(), QOpenGLFunctions(), m_baseColor(color), m_parent(parent) @@ -332,7 +332,9 @@ void SkinOpenGLWindow::setElytraVisible(bool visible) bool SkinOpenGLWindow::hasOpenGL() { - if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("%1_DISABLE_GLVULKAN").arg(BuildConfig.LAUNCHER_ENVNAME)).isEmpty()) { + if (!QProcessEnvironment::systemEnvironment() + .value(QStringLiteral("%1_DISABLE_GLVULKAN").arg(BuildConfig.LAUNCHER_ENVNAME)) + .isEmpty()) { return false; }