Rémi Bernon (@rbernon) commented about dlls/winex11.drv/init.c:
- struct x11drv_win_data *data; RECT rect, client; UINT ret = 0; HRGN region; HDC hdc;
- if (!(data = get_win_data( hwnd ))) return TRUE; - client = data->rects.client; - release_win_data( data ); + NtUserGetClientRect( hwnd, &client, NtUserGetDpiForWindow( hwnd ) ); OffsetRect( &client, -client.left, -client.top );
if (!(hdc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_USESTYLE ))) return FALSE; if ((region = NtGdiCreateRectRgn( 0, 0, 0, 0 ))) { ret = NtGdiGetRandomRgn( hdc, region, SYSRGN | NTGDI_RGN_MONITOR_DPI ); Actually, you need to either use `NtUserGetWinMonitorDpi` here, or remove `NTGDI_RGN_MONITOR_DPI` from the `NtGdiGetRandomRgn` call. The latter being possibly better as it will avoid any rounding and the eventually related issues.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/7106#note_91558