Rémi Bernon (@rbernon) commented about dlls/win32u/window.c:
intersect_rect( &rect, &rect, &surface_rect ); if (!(hdc = NtGdiCreateCompatibleDC( 0 ))) goto done;
window_surface_lock( surface );
if (surface != &dummy_surface) pthread_mutex_lock( &surfaces_lock ); NtGdiSelectBitmap( hdc, surface->color_bitmap );
This isn't right, surfaces bitmaps should not be used without locking them.
What we should do here, is to detect that the src DC is the windows's DC, in which case it should be unnecessary to create a new one, and unnecessary to lock the surface
Something like this maybe, but I'm not completely sure about it:
```suggestion:-2+0 if (NtUserWindowFromDC( hdc_src ) == hwnd) hdc = hdc_src; else { if (!(hdc = NtGdiCreateCompatibleDC( 0 ))) goto done; if (surface != &dummy_surface) pthread_mutex_lock( &surfaces_lock ); NtGdiSelectBitmap( hdc, surface->color_bitmap ); } ```
You would need something similar on the unlock side.