From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/tests/opengl.c | 2 +- dlls/win32u/opengl.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index 6f73e36732c..f15f456bdfa 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -2749,7 +2749,7 @@ static void test_window_dc(void)
todo_wine ok_ret( TRUE, wglMakeCurrent( NULL, NULL ) ); ok_ret( TRUE, wglDeleteContext( ctx ) ); - todo_wine ok_ret( TRUE, SwapBuffers( dc ) ); + ok_ret( TRUE, SwapBuffers( dc ) ); ReleaseDC( window, dc );
DestroyWindow(window); diff --git a/dlls/win32u/opengl.c b/dlls/win32u/opengl.c index 092202348a1..3bbf0d4cb93 100644 --- a/dlls/win32u/opengl.c +++ b/dlls/win32u/opengl.c @@ -1953,12 +1953,13 @@ static BOOL win32u_wglSwapBuffers( HDC hdc )
TRACE( "context %p, hwnd %p, draw_hdc %p, interval %d\n", context, hwnd, draw_hdc, interval );
- context_sync_drawables( context, draw_hdc, read_hdc ); + if (context) context_sync_drawables( context, draw_hdc, read_hdc ); + + if (context) opengl_drawable_add_ref( (draw = context->draw) ); + else if (!(draw = get_window_opengl_drawable( hwnd ))) return FALSE;
- if (!(draw = get_dc_opengl_drawable( draw_hdc ))) return FALSE; opengl_drawable_flush( draw, interval, 0 ); - if (!draw->client) ret = FALSE; /* pbuffer, nothing to do */ - else ret = draw->funcs->swap( draw ); + ret = draw->funcs->swap( draw ); opengl_drawable_release( draw );
return ret;