Wayland: Fix window opacity on older systems

On systems lacking the EGL_EXT_present_opaque extension, some
compositors treat any buffer with an alpha channel as per-pixel
transparent.

This commit ignores any EGLConfig with an alpha channel if the extension
is missing and the window is created with GLFW_TRANSPARENT_FRAMEBUFFER
set to false.

This is technically not a breaking change since GLFW_ALPHA_BITS is not
a hard constraint, but it is still going to inconvenience anyone using
the framebuffer alpa channel to store other kinds of data.

Related to #1895

(cherry picked from commit ef6c9d8b4f)
This commit is contained in:
Camilla Löwy
2022-07-25 20:33:47 +02:00
parent 1f675ab62f
commit 8b4f1ebbea
4 changed files with 28 additions and 0 deletions

View File

@@ -312,6 +312,19 @@ Starting with GLFW 3.3.7, events posted with @ref glfwPostEmptyEvent now use a s
unnamed pipe instead of sending an X11 client event to the helper window.
@subsubsection wayland_alpha_34 Frambuffer may lack alpha channel on older Wayland systems
On Wayland, when creating an EGL context on a machine lacking the new
`EGL_EXT_present_opaque` extension, the @ref GLFW_ALPHA_BITS window hint will be
ignored and the framebuffer will have no alpha channel. This is because some
Wayland compositors treat any buffer with an alpha channel as per-pixel
transparent.
If you want a per-pixel transparent window, see the
[GLFW_TRANSPARENT_FRAMEBUFFER](@ref GLFW_TRANSPARENT_FRAMEBUFFER_hint) window
hint.
@subsection deprecations_33 Deprecations in version 3.3
@subsubsection charmods_callback_33 Character with modifiers callback