File: 12_glx-do-not-pick-sRGB-config-for-32-bit-RGBA-visual.patch

package info (click to toggle)
xorg-server 2:1.19.2-1+deb9u5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 41,820 kB
  • sloc: ansic: 372,380; xml: 18,082; makefile: 3,482; objc: 3,470; sh: 813; python: 514; yacc: 483; cpp: 479; lex: 281; asm: 214; awk: 52; perl: 5
file content (31 lines) | stat: -rw-r--r-- 1,374 bytes parent folder | download
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
commit c2954b16c8730c7ed8441fd8dba25900f3aed265
Author: Tapani Pälli <tapani.palli@intel.com>
Date:   Tue Nov 28 09:23:29 2017 +0200

    glx: do not pick sRGB config for 32-bit RGBA visual
    
    This fixes blending issues seen with kwin and gnome-shell when
    32bit visual has sRGB capability set.
    
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103699
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103646
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103655

diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 73444152a..596d972e0 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -271,6 +271,11 @@ pickFBConfig(__GLXscreen * pGlxScreen, VisualPtr visual)
         /* If it's the 32-bit RGBA visual, demand a 32-bit fbconfig. */
         if (visual->nplanes == 32 && config->rgbBits != 32)
             continue;
+        /* If it's the 32-bit RGBA visual, do not pick sRGB capable config.
+         * This can cause issues with compositors that are not sRGB aware.
+         */
+        if (visual->nplanes == 32 && config->sRGBCapable == GL_TRUE)
+            continue;
         /* Can't use the same FBconfig for multiple X visuals.  I think. */
         if (config->visualID != 0)
             continue;