From b9db43403461b5e87bb40b3d2fc0b5dbcea24542 Mon Sep 17 00:00:00 2001 From: Anton Baskanov Date: Mon, 14 Aug 2023 16:04:33 +0700 Subject: [PATCH] winex11.drv: Mark drawable as dirty when setting pixel format. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55341 --- dlls/winex11.drv/opengl.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index c23df82c7b9..c9000648848 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1393,17 +1393,27 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct wgl_pixel */ static BOOL set_win_format( HWND hwnd, const struct wgl_pixel_format *format, BOOL internal ) { - struct gl_drawable *gl; + struct gl_drawable *old, *gl; if (!format->visual) return FALSE; - if (!(gl = create_gl_drawable( hwnd, format, FALSE, internal ))) return FALSE; + old = get_gl_drawable( hwnd, 0 ); + + if (!(gl = create_gl_drawable( hwnd, format, FALSE, internal ))) + { + release_gl_drawable( old ); + return FALSE; + } TRACE( "created GL drawable %lx for win %p %s\n", gl->drawable, hwnd, debugstr_fbconfig( format->fbconfig )); + if (old) + mark_drawable_dirty( old, gl ); + XFlush( gdi_display ); release_gl_drawable( gl ); + release_gl_drawable( old ); win32u_set_window_pixel_format( hwnd, pixel_format_index( format ), internal ); return TRUE;