Fix opengl initialisation on wayland #439

Open
opened 2026-04-05 16:20:59 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @bapt on 3/6/2026

glewInit() returns GLEW_ERROR_NO_GLX_DISPLAY (error code 4) when running under Wayland/EGL. GLEW successfully loads all core GL function pointers via EGL, but then fails on the GLX initialization path and reports an error. The code was treating this as a fatal error, blocking all OpenGL rendering.

As a workaround, accept GLEW_ERROR_NO_GLX_DISPLAY as a non-fatal result alongside GLEW_OK.

Description

While porting OrcaSlicer on FreeBSD (related patches to come later) I figure that what starting OrcaSlicer on wayland, the opengl was not rendered at all, This patch fixes it.

Tests

I started OrcaSlicer under sway and got the UI but couldn't preview or prepare anything as the opengl part was not initialize. After this patch, it works as expected.

*Originally created by @bapt on 3/6/2026* glewInit() returns GLEW_ERROR_NO_GLX_DISPLAY (error code 4) when running under Wayland/EGL. GLEW successfully loads all core GL function pointers via EGL, but then fails on the GLX initialization path and reports an error. The code was treating this as a fatal error, blocking all OpenGL rendering. As a workaround, accept GLEW_ERROR_NO_GLX_DISPLAY as a non-fatal result alongside GLEW_OK. # Description While porting OrcaSlicer on FreeBSD (related patches to come later) I figure that what starting OrcaSlicer on wayland, the opengl was not rendered at all, This patch fixes it. ## Tests I started OrcaSlicer under sway and got the UI but couldn't preview or prepare anything as the opengl part was not initialize. After this patch, it works as expected.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#439