Module: wine Branch: master Commit: 6dd2ed2c7dd6eb7c05e96f8373f639ea975cb9f0 URL: https://gitlab.winehq.org/wine/wine/-/commit/6dd2ed2c7dd6eb7c05e96f8373f639e...
Author: Rémi Bernon rbernon@codeweavers.com Date: Fri Dec 16 11:28:32 2022 +0100
winex11: Check pixel format flags in X11DRV_wglChoosePixelFormatARB.
The check was dropped in e392e0ac2846edc25610723c19d6a796372017e1, leaving the dwFlags variable unused.
---
dlls/opengl32/tests/opengl.c | 2 +- dlls/winex11.drv/opengl.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index 3b49f8d2149..42c2626a2c2 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -1891,7 +1891,7 @@ static void test_wglChoosePixelFormatARB(HDC hdc)
ok(format.dwFlags & PFD_DRAW_TO_WINDOW, "got dwFlags %#lx\n", format.dwFlags); ok(format.dwFlags & PFD_SUPPORT_OPENGL, "got dwFlags %#lx\n", format.dwFlags); - todo_wine ok(format.dwFlags & PFD_SUPPORT_GDI, "got dwFlags %#lx\n", format.dwFlags); + ok(format.dwFlags & PFD_SUPPORT_GDI, "got dwFlags %#lx\n", format.dwFlags);
winetest_pop_context(); } diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 52f363461e4..96a8526604b 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -2638,6 +2638,8 @@ static BOOL X11DRV_wglChoosePixelFormatARB( HDC hdc, const int *piAttribIList, c
if (i == nb_pixel_formats) continue; + if ((pixel_formats[i].dwFlags & dwFlags) != dwFlags) + continue;
format = &formats[format_count]; format->format = i + 1;