keep the window framebuffer opaque

Both backends asked for an alpha channel (GLFW defaults to 8 alpha
bits, the Wayland EGL config requested 8), so everything the engine
draws with alpha - the UI panels, the water post effect - lowered the
window's own alpha and the compositor blended the desktop through it.
Visible on wine/Proton, where the whole window is composited.

Both now ask for an opaque framebuffer: GLFW_ALPHA_BITS 0, and
EGL_ALPHA_SIZE 0 with a fallback to an alpha config if the driver
provides none. Checked the result through the back buffer attachment:
alpha size is 0 on Wayland and on X11.
This commit is contained in:
alexei-zebra 2026-10-09 16:25:14 +03:00
parent 918051cd5d
commit 4731ac0706
No known key found for this signature in database
GPG key ID: D19D450AC3D9A80E
2 changed files with 5 additions and 2 deletions

View file

@ -603,6 +603,9 @@ std::tuple<
#endif
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE);
glfwWindowHint(GLFW_SAMPLES, settings->samples.get());
// opaque window: the UI is drawn with alpha and would otherwise
// blend with the desktop behind the window
glfwWindowHint(GLFW_ALPHA_BITS, 0);
auto window = glfwCreateWindow(width, height, title.c_str(), nullptr, nullptr);
if (window == nullptr) {

View file

@ -126,7 +126,7 @@ wayland_window_initialize(DisplaySettings* settings, std::string title) {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8, EGL_DEPTH_SIZE, 24, EGL_STENCIL_SIZE, 8,
EGL_ALPHA_SIZE, 0, EGL_DEPTH_SIZE, 24, EGL_STENCIL_SIZE, 8,
EGL_SAMPLES, samples > 0 ? samples : 0,
EGL_NONE
};
@ -137,7 +137,7 @@ wayland_window_initialize(DisplaySettings* settings, std::string title) {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8, EGL_DEPTH_SIZE, 24, EGL_STENCIL_SIZE, 8,
EGL_ALPHA_SIZE, 0, EGL_DEPTH_SIZE, 24, EGL_STENCIL_SIZE, 8,
EGL_NONE
};
eglChooseConfig(