summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHal Gentz <[email protected]>2019-10-10 18:35:50 -0600
committerAdam Jackson <[email protected]>2019-10-11 21:57:21 +0000
commita800d16e4f1589e41e53edf8e8a771a33bb46a6a (patch)
tree6d6304385e59648344dd8b930ee502fab1b4115c /src
parent90a19074b4e1d4d8f8ababaade8170c05aeecffe (diff)
egl: Puts RGBA visuals in the second config selection group.
That way applications don't get windows that are compositor alpha-blended accidentally. In the ideal world, this would be done by the xserver, as it does for GLX, however, an appropriate place could not be found, so it's being placed here instead. Fixes: 049f343e8ac "egl: Allow 24-bit visuals for 32-bit RGBA8888 configs" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67676 Cc: [email protected] Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Hal Gentz <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/dri2/platform_x11.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index 414d5f74c5d..b3ed7b943da 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -831,9 +831,17 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
dri2_conf = dri2_add_config(disp, config, config_count + 1,
surface_type, config_attrs,
rgba_shifts, rgba_sizes);
- if (dri2_conf)
+ if (dri2_conf) {
if (dri2_conf->base.ConfigID == config_count + 1)
config_count++;
+
+ /* Put RGBA visuals in the second ConfigSelectGroup so that they
+ * have lower priority. Applications probably don't want the
+ * compositor to alpha-blend their windows.
+ */
+ if (d.data->depth != 24 && d.data->depth != 30)
+ ++dri2_conf->base.ConfigSelectGroup;
+ }
}
}