From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/bitblt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index d7d5c93ea64..25193d46bb0 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -2088,10 +2088,11 @@ struct window_surface *create_surface( HWND hwnd, Window window, const XVisualIn D3DKMT_CREATEDCFROMMEMORY desc = { .Width = info->bmiHeader.biWidth, - .Height = info->bmiHeader.biHeight, - .Pitch = info->bmiHeader.biWidth * info->bmiHeader.biBitCount / 8, + .Height = abs( info->bmiHeader.biHeight ), + .Pitch = info->bmiHeader.biSizeImage / abs( info->bmiHeader.biHeight ), .Format = d3d_format, .pMemory = image->ximage->data, + .hDeviceDc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_WINDOW ), };
if (!NtGdiDdDDICreateDCFromMemory( &desc )) @@ -2099,6 +2100,7 @@ struct window_surface *create_surface( HWND hwnd, Window window, const XVisualIn bitmap = desc.hBitmap; NtGdiDeleteObjectApp( desc.hDc ); } + if (desc.hDeviceDc) NtUserReleaseDC( hwnd, desc.hDeviceDc ); }
if (!(surface = calloc( 1, size )))