From 4731ac0706e85dbaa35d2f5f80ce6ebefaccfcc3 Mon Sep 17 00:00:00 2001 From: alexei-zebra Date: Fri, 9 Oct 2026 16:25:14 +0300 Subject: [PATCH] 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. --- src/window/detail/GLFWWindow.cpp | 3 +++ src/window/wayland/WaylandInit.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/window/detail/GLFWWindow.cpp b/src/window/detail/GLFWWindow.cpp index 59f637fb1..88161de93 100644 --- a/src/window/detail/GLFWWindow.cpp +++ b/src/window/detail/GLFWWindow.cpp @@ -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) { diff --git a/src/window/wayland/WaylandInit.cpp b/src/window/wayland/WaylandInit.cpp index fdd52b942..667a71523 100644 --- a/src/window/wayland/WaylandInit.cpp +++ b/src/window/wayland/WaylandInit.cpp @@ -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(