aboutsummarylogtreecommitdiffstats
path: root/0004-fix-broken-opengl-screenshots-on-mutter.patch
blob: c850f99cb3814a5c06e89513a1ca288af705e34a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 4d47891ca1f3979c20f0acc3539a80d8fa97a2ad Mon Sep 17 00:00:00 2001
From: ninja- <ninja-@users.noreply.github.com>
Date: Tue, 30 Jun 2020 19:41:52 +0200
Subject: [PATCH 4/4] fix broken opengl screenshots on mutter

(admicos) This breaks more than just screenshots. On sway, the window is
rendered half transparent. And we do not want that.
---
 src/egl_context.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/egl_context.c b/src/egl_context.c
index 975c67be..b5cbeaff 100644
--- a/src/egl_context.c
+++ b/src/egl_context.c
@@ -175,6 +175,14 @@ static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig,
         u->samples = getEGLConfigAttrib(n, EGL_SAMPLES);
         u->doublebuffer = desired->doublebuffer;
 
+#if defined(_GLFW_WAYLAND)
+        // Avoid using transparent buffer on Wayland if transparency is not requested.
+        // Otherwise mutter will fail to properly screenshot OpenGL content.
+        if (u->alphaBits > 0 && !desired->transparent) {
+            continue;
+        }
+#endif // _GLFW_WAYLAND
+
         u->handle = (uintptr_t) n;
         usableCount++;
     }
-- 
2.32.0