From e524fa5b6bb2b007d285cb5eeeb709b057672971 Mon Sep 17 00:00:00 2001 From: DioEgizio <83089242+DioEgizio@users.noreply.github.com> Date: Fri, 20 Mar 2026 15:31:34 +0100 Subject: [PATCH] fix: allow disabling gl and vulkan features with an envvar and disable it by default on appimage/portable the previous approach didn't work with runtime symbol lookup errors Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com> --- .github/actions/package/linux/action.yml | 2 ++ launcher/HardwareInfo.cpp | 7 +++++++ launcher/Launcher.in | 5 +++++ launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp | 5 +++++ 4 files changed, 19 insertions(+) diff --git a/.github/actions/package/linux/action.yml b/.github/actions/package/linux/action.yml index 90ff72aa1..cd888409f 100644 --- a/.github/actions/package/linux/action.yml +++ b/.github/actions/package/linux/action.yml @@ -90,6 +90,8 @@ runs: # FIXME(@getchoo): gamemode doesn't seem to be very portable with DBus. Find a way to make it work! 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 #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/launcher/HardwareInfo.cpp b/launcher/HardwareInfo.cpp index 1d4650ba9..9f0ce7cad 100644 --- a/launcher/HardwareInfo.cpp +++ b/launcher/HardwareInfo.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #ifndef Q_OS_MACOS #include @@ -30,6 +31,9 @@ namespace { bool vulkanInfo(QStringList& out) { + if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("LAUNCHER_DISABLE_GLVULKAN")).isEmpty()) { + return false; + } #ifndef Q_OS_MACOS QVulkanInstance inst; if (!inst.create()) { @@ -53,6 +57,9 @@ bool vulkanInfo(QStringList& out) bool openGlInfo(QStringList& out) { + if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("LAUNCHER_DISABLE_GLVULKAN")).isEmpty()) { + return false; + } QOpenGLContext ctx; if (!ctx.create()) { qWarning() << "OpenGL context creation failed"; diff --git a/launcher/Launcher.in b/launcher/Launcher.in index 0e84bdd9d..a7845b294 100755 --- a/launcher/Launcher.in +++ b/launcher/Launcher.in @@ -21,6 +21,11 @@ echo "Launcher Dir: ${LAUNCHER_DIR}" # Makes the launcher use portals for file picking 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 +fi + # Just to be sure... chmod +x "${LAUNCHER_DIR}/bin/${LAUNCHER_NAME}" diff --git a/launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp b/launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp index 52799a7b9..988996918 100644 --- a/launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp +++ b/launcher/ui/dialogs/skins/draw/SkinOpenGLWindow.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -330,6 +331,10 @@ void SkinOpenGLWindow::setElytraVisible(bool visible) bool SkinOpenGLWindow::hasOpenGL() { + if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("LAUNCHER_DISABLE_GLVULKAN")).isEmpty()) { + return false; + } + QOpenGLContext ctx; return ctx.create(); }