From 3f0ecf769de461ddd99be536b64e4626a6f83770 Mon Sep 17 00:00:00 2001 From: flightlessmango Date: Thu, 4 Apr 2024 21:58:55 +0200 Subject: [PATCH] Fix minecraft-launcher issue GlxMakeCurrent fails for some reason in minecraft-launcher. Bypassing it by blacklisting is not sufficient as it still runs GlxMakeCurrent, so we bypass using that function for minecraft-launcher completely --- src/gl/inject_glx.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gl/inject_glx.cpp b/src/gl/inject_glx.cpp index 8fede725..a20aa337 100644 --- a/src/gl/inject_glx.cpp +++ b/src/gl/inject_glx.cpp @@ -19,6 +19,7 @@ #include #include "gl_hud.h" +#include "../config.h" using namespace MangoHud::GL; @@ -106,7 +107,12 @@ EXPORT_C_(void) glXDestroyContext(void *dpy, void *ctx) EXPORT_C_(int) glXMakeCurrent(void* dpy, void* drawable, void* ctx) { glx.Load(); SPDLOG_DEBUG("{}: {}, {}", __func__, drawable, ctx); - int ret = glx.MakeCurrent(dpy, drawable, ctx); + int ret; + // This is hack, proper fix should be implemented. + // MakeCurrent fails on the minecraft-launcher so we + // just bypass it and minecraft hooking works as it should + if (get_program_name() != "minecraft-launcher") + ret = glx.MakeCurrent(dpy, drawable, ctx); if (!is_blacklisted()) { if (ret) {