https://bugs.winehq.org/show_bug.cgi?id=50539
Bug ID: 50539 Summary: SetWindowRgn doesn't work correctly Product: Wine Version: 6.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: hjkl@quantentunnel.de Distribution: ---
Created attachment 69208 --> https://bugs.winehq.org/attachment.cgi?id=69208 Example images and source code
The SetWindowRgn function doesn't work correctly. It applies a shape to a window. In the attachment is an example source code which just creates 2 windows and calls SetWindowRgn on both. It uses an elliptic region on the left window and a triangle region on the right one.
The image "CorrectOnWindows.png" shows how Windows 10 draws it. The image "IncorrectOnLinuxWithWine.png" shows how Wine on Debian draws it (also tested on Zorin OS with the same result).
The elliptic window has a black "shadow" above the window. This might be the same issue as described in "Bug 48636", but I'm not sure. The other window has no shape at all. It's just drawn like SetWindowRgn was never called.
The folder "source" of the attached ZIP file contains the Visual Studio 2019 source project and also the compiled EXEs for 32-bit and 64-bit. It's very simple. The interesting part is this for the 1st window:
//example 1 with an elliptic region HRGN hRgn=CreateEllipticRgn(0, 0, 250, 200);
SetWindowRgn(g_hWnd1, hRgn, TRUE);
And this for the 2nd window:
//example 2 with a triangle region POINT points[8];
points[0].x=50; points[0].y=0; points[1].x=100; points[1].y=100; points[2].x=0; points[2].y=100; points[3].x=50; points[3].y=0; points[4].x=50; points[4].y=20; points[5].x=80; points[5].y=90; points[6].x=20; points[6].y=90; points[7].x=50; points[7].y=20; hRgn=CreatePolygonRgn(points, 8, ALTERNATE);
SetWindowRgn(g_hWnd2, hRgn, TRUE);