mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
glx: Perform check for valid fbconfig against proper X-Screen.
Commitcf804b4455('glx: fix crash with bad fbconfig') introduced a check in glXCreateNewContext() if the given config is a valid fbconfig. Unfortunately the check always checks the given config against the fbconfigs of the DefaultScreen(dpy), instead of the actual X-Screen specified in the config config->screen. This leads to failure whenever a GL context is created on a non-DefaultScreen(dpy), e.g., on X-Screen 1 of a multi-x-screen setup, where the default screen is typically 0. Fix this by using config->screen instead of DefaultScreen(dpy). Tested to fix context creation failure on a dual-x-screen setup. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit0c94ed0987)
This commit is contained in:
parent
80409971c0
commit
50afa72f3c
1 changed files with 1 additions and 2 deletions
|
|
@ -1630,7 +1630,6 @@ glXCreateNewContext(Display * dpy, GLXFBConfig fbconfig,
|
|||
int renderType, GLXContext shareList, Bool allowDirect)
|
||||
{
|
||||
struct glx_config *config = (struct glx_config *) fbconfig;
|
||||
int screen = DefaultScreen(dpy);
|
||||
struct glx_config **config_list;
|
||||
int list_size;
|
||||
unsigned i;
|
||||
|
|
@ -1641,7 +1640,7 @@ glXCreateNewContext(Display * dpy, GLXFBConfig fbconfig,
|
|||
}
|
||||
|
||||
config_list = (struct glx_config **)
|
||||
glXGetFBConfigs(dpy, screen, &list_size);
|
||||
glXGetFBConfigs(dpy, config->screen, &list_size);
|
||||
|
||||
for (i = 0; i < list_size; i++) {
|
||||
if (config_list[i] == config)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue