From 9d3eafa1a242fa6f9c9921092ad9c4ed01c2167f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 17 Jun 2016 11:38:13 -0400 Subject: [PATCH] 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. --- src/wl_window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wl_window.c b/src/wl_window.c index 04cbd997f..0deea6353 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -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)