From: Zhiyi Zhang zzhang@codeweavers.com
When emulating a non-native aspect ratio display mode, calling map_monitor_rect() to map the physical work area to the emulate work area might produce a rectangle larger than the emulated display mode. For example, a physical work area (0,0,3840,2096) gets mapped to (0,-180,2560,1217) when the emulated display mode is 2560x1080 and the physical display mode is 3840x2160. In such cases, we should limit the work area to the emulated monitor rectangle. --- dlls/win32u/sysparams.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 026403a1e06..463b6b00f68 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1989,6 +1989,7 @@ static void monitor_get_info( struct monitor *monitor, MONITORINFO *info, UINT d { info->rcMonitor = monitor_get_rect( monitor, dpi, MDT_DEFAULT ); info->rcWork = map_monitor_rect( monitor, monitor->rc_work, 0, MDT_RAW_DPI, dpi, MDT_DEFAULT ); + intersect_rect( &info->rcWork, &info->rcWork, &info->rcMonitor ); info->dwFlags = is_monitor_primary( monitor ) ? MONITORINFOF_PRIMARY : 0;
if (info->cbSize >= sizeof(MONITORINFOEXW))