mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
egl/x11: Move RGBA visuals in the second config selection group
This ensures that alpha-blended windows are at the bottom of the visuals
list, so they don't get picked up accidentally.
Based on: "egl-X11: Put RGBA visuals in the second config selection group"
Suggested-by: Freya Gentz <zegentzy@protonmail.com> # original concept
Co-authored-by: Robert Mader <robert.mader@posteo.de>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9989>
(cherry picked from commit 3736c9997c)
This commit is contained in:
parent
981703aac9
commit
f2d36e3d6e
2 changed files with 17 additions and 2 deletions
|
|
@ -2604,7 +2604,7 @@
|
|||
"description": "egl/x11: Move RGBA visuals in the second config selection group",
|
||||
"nominated": false,
|
||||
"nomination_type": 3,
|
||||
"resolution": 4,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -821,6 +821,16 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
|
|||
EGL_NONE,
|
||||
};
|
||||
|
||||
const EGLint config_attrs_2nd_group[] = {
|
||||
EGL_NATIVE_VISUAL_ID,
|
||||
visuals[i].visual_id,
|
||||
EGL_NATIVE_VISUAL_TYPE,
|
||||
visuals[i]._class,
|
||||
EGL_CONFIG_SELECT_GROUP_EXT,
|
||||
1,
|
||||
EGL_NONE,
|
||||
};
|
||||
|
||||
for (int j = 0; dri2_dpy->driver_configs[j]; j++) {
|
||||
const __DRIconfig *config = dri2_dpy->driver_configs[j];
|
||||
int shifts[4];
|
||||
|
|
@ -854,7 +864,12 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
|
|||
continue;
|
||||
}
|
||||
|
||||
dri2_add_config(disp, config, surface_type, config_attrs);
|
||||
unsigned int bit_per_pixel = sizes[0] + sizes[1] + sizes[2] + sizes[3];
|
||||
if (sizes[3] != 0 && d.data->depth == bit_per_pixel) {
|
||||
dri2_add_config(disp, config, surface_type, config_attrs_2nd_group);
|
||||
} else {
|
||||
dri2_add_config(disp, config, surface_type, config_attrs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue