Did you set the init hint GLFW_PLATFORM? It may be that since that was introduced the environment variable doesn’t matter. In any way, I would so something like this:
if(glfwPlatformSupported(GLFW_PLATFORM_WIN32)) glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_WIN32);
else if(glfwPlatformSupported(GLFW_PLATFORM_COCOA)) glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_COCOA);
else if(glfwPlatformSupported(GLFW_PLATFORM_X11)) glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_X11);
else if(glfwPlatformSupported(GLFW_PLATFORM_WAYLAND)) glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_WAYLAND);
else {
fprintf(stderr, "Error: could not find acceptable platform for GLFW\n");
abort();
}
before the code you have written above (maybe rearrange the cases for whatever priority you want to have). Maybe you can try if somthing like that helps your case.
This worked for me!
I was having a similar issue but oddly enough it either would or wouldn’t work depending on how I started my binary…
opening it from the file explorer, kitty terminal or the gnome terminal worked just fine, but for some reason Alacritty specifically just had a really big issue figuring out how to start a glfw window