wayland: Only set the opaque region if we got a opaque buffer

If the application set the window ALPHA_BITS hint to > 0, we will
choose an RGBA buffer instead of an RGBX buffer, meaning it will not be
opaque, and if so, lets not lie to the compositor saying it's opaque.
This commit is contained in:
Jonas Ådahl 2016-06-17 11:38:13 -04:00
parent 6019072eef
commit 9d3eafa1a2

View File

@ -178,6 +178,12 @@ static const struct wl_surface_listener surfaceListener = {
static void setOpaqueRegion(_GLFWwindow* window)
{
struct wl_region* region;
int alphaBits;
eglGetConfigAttrib(_glfw.egl.display, window->context.egl.config,
EGL_ALPHA_SIZE, &alphaBits);
if (alphaBits > 0)
return;
region = wl_compositor_create_region(_glfw.wl.compositor);
if (!region)