Module: wine Branch: master Commit: 446da60e78beb321d776b48cdee6f764c81b924b URL: https://gitlab.winehq.org/wine/wine/-/commit/446da60e78beb321d776b48cdee6f76...
Author: Paul Gofman pgofman@codeweavers.com Date: Mon Mar 13 17:07:56 2023 -0600
winex11.drv: Don't allow changing internal pixel format if conflicts with non-internal.
---
dlls/winex11.drv/opengl.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index b2169de9bf7..565df8bb4c6 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1412,6 +1412,7 @@ static BOOL set_pixel_format( HDC hdc, int format, BOOL internal ) const struct wgl_pixel_format *fmt; int value; HWND hwnd = NtUserWindowFromDC( hdc ); + int prev;
TRACE("(%p,%d)\n", hdc, format);
@@ -1435,14 +1436,12 @@ static BOOL set_pixel_format( HDC hdc, int format, BOOL internal ) return FALSE; }
- if (!internal) - { - /* cannot change it if already set */ - int prev = win32u_get_window_pixel_format( hwnd ); - - if (prev) - return prev == format; - } + /* Even for internal pixel format fail setting it if the app has already set a + * different pixel format. Let wined3d create a backup GL context instead. + * Switching pixel format involves drawable recreation and is much more expensive + * than blitting from backup context. */ + if ((prev = win32u_get_window_pixel_format( hwnd ))) + return prev == format;
return set_win_format( hwnd, fmt, internal ); }