mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-15 21:14:35 +02:00
Wayland: fail window creation cleanly when the OpenGL context cannot be created
_glfwPlatformCreateWindow() ignored the return value of attach_opengl_context_to_window(), so when EGL is unavailable (for example libEGL cannot be loaded) it reported success with window->context left zeroed. glfwCreateWindow() then proceeded to _glfwRefreshContextAttribs() -> glfwMakeContextCurrent(), which calls the NULL context.makeCurrent pointer: kitty crashes with SIGSEGV instead of reporting "Failed to create GLFWwindow. This usually happens because of old/broken OpenGL drivers." as intended. The X11 backend already propagates these failures. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2
glfw/wl_window.c
vendored
2
glfw/wl_window.c
vendored
@@ -1509,7 +1509,7 @@ int _glfwPlatformCreateWindow(
|
||||
// and only then create the OpenGL context.
|
||||
if (window->wl.visible) loop_till_window_fully_created(window);
|
||||
debug("Creating OpenGL context and attaching it to window\n");
|
||||
if (ctxconfig->client != GLFW_NO_API) attach_opengl_context_to_window(window, ctxconfig, fbconfig);
|
||||
if (ctxconfig->client != GLFW_NO_API && !attach_opengl_context_to_window(window, ctxconfig, fbconfig)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user